Ponytech / appstoreconnectapi

Python wrapper around Apple App Store Api
https://ponytech.net/projects/app-store-connect
MIT License
161 stars 74 forks source link

RecursionError when accessing relationships on Build resource #38

Closed fredyshox closed 3 years ago

fredyshox commented 3 years ago

When I try to get preReleaseVersion from Build resource I get:

    app_version = build.preReleaseVersion().version
  File "/usr/local/lib/python3.9/site-packages/appstoreconnect/resources.py", line 16, in __getattr__
    if item in self.relationships:
  File "/usr/local/lib/python3.9/site-packages/appstoreconnect/resources.py", line 16, in __getattr__
    if item in self.relationships:
  File "/usr/local/lib/python3.9/site-packages/appstoreconnect/resources.py", line 16, in __getattr__
    if item in self.relationships:
  [Previous line repeated 993 more times]
  File "/usr/local/lib/python3.9/site-packages/appstoreconnect/resources.py", line 12, in __getattr__
    if item == 'id':
RecursionError: maximum recursion depth exceeded in comparison

I suspect this is caused by Build not having relationships static field, like the other ones.

Python 3.9.2, Version: 0.9.0, I think it was working fine on 0.8.X

ppawlak commented 3 years ago

@fredyshox Thanks for reporting the issue. I had successfully reproduced it. I'll try to fix it as soon as possible.

ppawlak commented 3 years ago

@fredyshox Sorry for the delay. You were right, the Build resource was missing the relationships attribute.

I just pushed a fix (https://github.com/Ponytech/appstoreconnectapi/commit/0916ac75790b13cf6c89617209a1a6c2db1f16d1). Do you mind checking it out and confirm everything works for your use case?