'vtkSlicerMarkupsModuleMRML.vtkMRMLMarkupsROINode' has no len()

  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???

Please copy here the command that produced this error.

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.

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…

我找到了原因: 是由于我用"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…

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).