# 'vtkSlicerMarkupsModuleMRML.vtkMRMLMarkupsROINode' has no len()

**URL:** <https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903>\
**Category:** Development\
**Tags:** python\
**Created:** [September 29, 2021, 12:02am UTC](https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903 "2021-09-29T00:02:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [September 29, 2021, 12:02am UTC](https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903/1 "2021-09-29T00:02:58Z")

</div>

```auto
  File "/Applications/Slice98.app/Contents/bin/Python/slicer/util.py", line 1307, in getNode
    nodes = getNodes(pattern, scene)
  File "/Applications/Slice98.app/Contents/bin/Python/slicer/util.py", line 1290, in getNodes
    if (fnmatch.fnmatchcase(name, pattern) or
  File "/Applications/Slice98.app/Contents/lib/Python/lib/python3.6/fnmatch.py", line 70, in fnmatchcase
    match = _compile_pattern(pat)
TypeError: unhashable type: 'numpy.ndarray'
odec can't decode byte 0xe5 in position 21801: ordinal not in range(128)
 'vtkSlicerMarkupsModuleMRML.vtkMRMLMarkupsROINode' has no len()

```

??? what’s wrong???

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 29, 2021, 3:11am UTC](https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903/2 "2021-09-29T03:11:12Z")

</div>

Please copy here the command that produced this error.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [September 29, 2021, 8:01am UTC](https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903/3 "2021-09-29T08:01:15Z")

</div>

I had this once in a script. Your’s has a ‘å’ character somewhere that Python does not like.

Replace the ‘å’ character by chr(0xe5).

As to why Python breaks with special characters in scripts while Slicer libs are compiled with UTF-8 support, I can’t tell.

---

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [September 29, 2021, 8:34am UTC](https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903/4 "2021-09-29T08:34:21Z")

</div>

Thanks @chir.set  
嗯, 我想问的是,这个错和’vtkMRMLMarkupsROINode’有啥关系呢? 最近得到这个报错好几次了…

> Well, what I want to ask is, what does this error have to do with’vtkMRMLMarkupsROINode’? I got this error several times recently…

---

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [September 29, 2021, 8:44am UTC](https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903/5 "2021-09-29T08:44:01Z")

</div>

我找到了原因: 是由于我用"slicer.util.getName(modName)"时,modName用了变量而不是字符串的名字…

> I found the reason: when I used “slicer.util.getName(modName)”, **modName** used a variable instead of a string name…

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 29, 2021, 6:53pm UTC](https://discourse.slicer.org/t/vtkslicermarkupsmodulemrml-vtkmrmlmarkupsroinode-has-no-len/19903/6 "2021-09-29T18:53:35Z")

</div>

> [@chir.set](#):
>
> As to why Python breaks with special characters in scripts while Slicer libs are compiled with UTF-8 support, I can’t tell.

It was a problem specific to how macOS loads files by default. I’ve fixed the issue now (see [Couldn't Reload, what's wrong - #4 by lassoan](https://discourse.slicer.org/t/couldnt-reload-whats-wrong/19893/4)).
