mcfletch / pyvrml97

PyVRML97 Scene Graph Model classes
Other
6 stars 1 forks source link

Linearise doesn't work on Python 3 - dict_values object has no attribute 'sort' #2

Open zulc22 opened 4 months ago

zulc22 commented 4 months ago
Traceback (most recent call last):
  File "C:\Users\Sadie\Documents\GitHub\vrml-ovrhd\vrml_ovrhd.py", line 71, in <module>
    fixup_vrml(file)
  File "C:\Users\Sadie\Documents\GitHub\vrml-ovrhd\vrml_ovrhd.py", line 30, in fixup_vrml
    wrldata = wrl.toString()
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\node.py", line 135, in toString
    return linearise.linearise( self, **namedargs )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 39, in linearise
    return l.linear( value )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 100, in linear
    self._linear( clientNode )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 499, in _linear
    return method( clientNode )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 142, in _sceneGraph
    self._proto( proto )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 193, in _proto
    self._eventDict( clientNode )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 361, in _eventDict
    fields.sort( lambda x,y: cmp(x.name,y.name) )
AttributeError: 'dict_values' object has no attribute 'sort'
zulc22 commented 4 months ago

i was able to fix this but it seems like there's something deeply wrong with linearise in general on python 3.10, i'm getting stuck in MFString_vrmlstr now...!

Traceback (most recent call last):
  File "C:\Users\Sadie\Documents\GitHub\vrml-ovrhd\vrml_ovrhd.py", line 71, in <module>
    fixup_vrml(file)
  File "C:\Users\Sadie\Documents\GitHub\vrml-ovrhd\vrml_ovrhd.py", line 30, in fixup_vrml
    wrldata = wrl.toString()
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\node.py", line 135, in toString
    return linearise.linearise( self, **namedargs )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 39, in linearise
    return l.linear( value )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 100, in linear
    self._linear( clientNode )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 499, in _linear
    return method( clientNode )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 142, in _sceneGraph
    self._proto( proto )
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\vrml97\linearise.py", line 201, in _proto
    buffer.write( fieldtypes.MFString_vrmlstr(clientNode.externalURL, self ))
  File "C:\Users\Sadie\AppData\Local\pypoetry\Cache\virtualenvs\vrml-ovrhd-jvd3026H-py3.10\lib\site-packages\vrml\fieldtypes.py", line 79, in MFString_vrmlstr
    anyobject = [ SFString_vrmlstr( v, lineariser) for v in value ]
TypeError: 'MFString' object is not iterable