Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compatibility when loading invalid JSON #565

Merged
merged 1 commit into from
Sep 4, 2018

Conversation

danielmitterdorfer
Copy link
Member

Previously we caught JSONDecodeError in the error handler when loading
JSON. However, this class has been introduced in Python 3.5 and thus we
fail on Python 3.4 with a confusing error message:

AttributeError: 'module' object has no attribute 'JSONDecodeError'

To avoid this situation, we broaden the except clause and also
introduce a new test case to ensure error handling works correctly on
all supported Python versions.

Closes #564

Previously we caught `JSONDecodeError` in the error handler when loading
JSON. However, this class has been introduced in Python 3.5 and thus we
fail with a confusing error message:

```
AttributeError: 'module' object has no attribute 'JSONDecodeError'
```

To avoid this situation, we broaden the `except` clause and also
introduce a new test case to ensure error handling works correctly on
all supported Python versions.

Closes elastic#564
@danielmitterdorfer danielmitterdorfer added bug Something's wrong :Track Management New operations, changes in the track format, track download changes and the like labels Sep 4, 2018
@danielmitterdorfer danielmitterdorfer added this to the 1.0.1 milestone Sep 4, 2018
@danielmitterdorfer danielmitterdorfer merged commit 52c266d into elastic:master Sep 4, 2018
@danielmitterdorfer danielmitterdorfer deleted the py34-compat branch September 4, 2018 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong :Track Management New operations, changes in the track format, track download changes and the like
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant