You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to access the frames property to find the winner of a game and I get this error:
Traceback (most recent call last):
File "/Users/oli/Documents/slippi-dashboard-api/test.py", line 5, in <module>
print(game.frames[0])
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 69, in __repr__
s = self._attr_repr(attr)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 62, in _attr_repr
return attr + '=' + _format(getattr(self, attr))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 26, in _format
return _format_collection(obj, '(', ')')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 15, in _format_collection
elements = [_format(x) for x in coll]
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 15, in <listcomp>
elements = [_format(x) for x in coll]
^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 32, in _format
return str(obj)
^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 69, in __repr__
s = self._attr_repr(attr)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 62, in _attr_repr
return attr + '=' + _format(getattr(self, attr))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 32, in _format
return str(obj)
^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 69, in __repr__
s = self._attr_repr(attr)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 62, in _attr_repr
return attr + '=' + _format(getattr(self, attr))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 32, in _format
return str(obj)
^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 69, in __repr__
s = self._attr_repr(attr)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 62, in _attr_repr
return attr + '=' + _format(getattr(self, attr))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 30, in _format
return repr(obj)
^^^^^^^^^
File "/Users/oli/Library/Caches/pypoetry/virtualenvs/slippi-dashboard-api-Jhn0YU0Z-py3.11/lib/python3.11/site-packages/slippi/util
.py", line 93, in __repr__
members, _ = enum._decompose(self.__class__, self._value_)
Code used to get the error:
from slippi import Game
game = Game("./replays/test2.slp")
print(game.frames[0])
Python version: 3.11.1
The text was updated successfully, but these errors were encountered:
I just encountered this after upgrading Python myself. Based on the name, _decompose is a private function of the enum library, and should never have been used by py-slippi in the first place. I assume it was removed in some recent Python version, and now py-slippi is not working.
Here is a corrected version of the IntFlag.__repr__ function using only documented attributes of the enum library:
def __repr__(self):
members = (name for name, value in self.__class__.__members__.items() if self & value)
return '%s:%s' % (bin(self._value_), '|'.join(members))
Until this is, hopefully soon, fixed in the library, you can monkey patch the fix into your code with:
I'm trying to access the frames property to find the winner of a game and I get this error:
Code used to get the error:
Python version: 3.11.1
The text was updated successfully, but these errors were encountered: