Gobot1234 / steam.py

An async python wrapper to interact with the Steam API and its CMs
https://steam-py.github.io/docs/latest
Other
171 stars 40 forks source link

Calling group.chunk raises "AttributeError: 'Group' object has no attribute '_partial_members'" #565

Closed truenicoco closed 4 months ago

truenicoco commented 4 months ago

Summary

I think this happens when the group.members attribute is filled.

Reproduction Steps

Expected Results

Get a full of the members of the group. As a workaround, I use:

        try:
            for m in await g.chunk():
                await self.get_participant_by_legacy_id(m.id)
        except AttributeError:
            for m in g.members:
                await self.get_participant_by_legacy_id(m.id)

Actual Results

  File "/venv/lib/python3.11/site-packages/legacy_module/group.py", line 162, in fill_participants
     for m in await g.chunk():
              ^^^^^^^^^^^^^^^
   File "/venv/lib/python3.11/site-packages/steam/group.py", line 40, in chunk
     self._members = dict.fromkeys(self._partial_members)  # type: ignore
                                   ^^^^^^^^^^^^^^^^^^^^^
 AttributeError: 'Group' object has no attribute '_partial_members'

System Information

python version: 3.11.2 steam.py version: 1.0.1 aiohttp version: 3.9.5 betterproto version: 2.0.0b6 operating system info: Linux-6.6.13+bpo-amd64-x86_64-with-glibc2.36

Checklist

Gobot1234 commented 4 months ago

Thanks for the report!