-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I ran into an error while reading ruby data:
Traceback (most recent call last):
File "….py", line 5, in <module>
d = rubymarshal.reader.load(f)
File "…/.local/lib/python3.8/site-packages/rubymarshal/reader.py", line 289, in load
return loader.read()
File "…/.local/lib/python3.8/site-packages/rubymarshal/reader.py", line 197, in read
attributes = self.read_attributes()
File "…/.local/lib/python3.8/site-packages/rubymarshal/reader.py", line 233, in read_attributes
attr_value = self.read()
File "…/.local/lib/python3.8/site-packages/rubymarshal/reader.py", line 125, in read
result[key] = value
TypeError: unhashable type: 'list'
Ruby doesn't (IIRC) have a different concept of tuples and arrays. I hacked around it by adding
if isinstance(key, list): # Workaround for non-hashable lists used as key
key = tuple(key)to the reading code for TYPE_HASH. It's a bit ad-hoc but I'm not sure what a consistent fix would be.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels