Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Fix bug with JSONDecodeError; add retries; fix iteration when collection is changing #21

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

apurvis
Copy link

@apurvis apurvis commented Aug 20, 2018

Combines #19 and #18 with added retry logic for RateLimitExceeded and other API errors.

  1. If tickets are closed while iterating over them with a Collection - either via the API or via the GUI - and the total_records in the response changes, you will always hit an unexplained IndexError at the end of you iteration. This PR should fix that in most cases - you can still iterate, but it will stop without raising IndexError.
  2. simplejson and json diverged a long time ago. The json.JSONDecodeError line is now incorrect and bombs out on an AttributeError when trying to catch exceptions.
  3. Add retry logic for API exceptions

'pycrypto',
'pytz',
'PyYAML',
'requests',
'future',
'simplejson',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of reintroducing the simplejson dependency -- which was intentionally removed -- could we instead fix the bug to work with the stdlib json module?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would definitely be a better approach but i'm not sure i will have time to make the change personally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants