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
Hi @JeremyVriens, thanks for bringing this to our attention! This was definitely a miss in the original PR. I've pushed up a quick test and fix (#6097) to appropriately catch and wrap the JSONDecodeError. Please let us know if you have any comments or concerns on the PR, otherwise, this should be addressed in the next minor release.
We've gone ahead and merged #6097. I'll close this since it's now on the path for release, but please feel free to leave any further comments here or on the PR.
This is a follow up on #5794, the issue is marked as resolved, but it's not completely resolved.
Expected Result
When no encoding is returned, you have simplejson installed and the content is not JSON, a requests.exceptions.JSONDecodeError should be raised.
Actual Result
A simplejson.errors.JSONDecodeError is raised.
Reproduction Steps
In the PR, related to the issue mentioned, the JSONDecodeError is only caught when there's an encoding (https://github.com/psf/requests/pull/5856/files#diff-633feaee006d302c2988a1f73e39e76a55ec077b595d8c0a093f72d75fb1799cR909-R911), this except clause should also be there a few lines above (when there's no encoding).
The text was updated successfully, but these errors were encountered: