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

Presence of simplejson module causes missed Exception #927

Closed
mgrubent opened this issue Sep 3, 2019 · 0 comments · Fixed by #928
Closed

Presence of simplejson module causes missed Exception #927

mgrubent opened this issue Sep 3, 2019 · 0 comments · Fixed by #928
Assignees
Labels
correctness A condition affecting the proper functionality.

Comments

@mgrubent
Copy link
Contributor

mgrubent commented Sep 3, 2019

Background

As described in psf/requests#4842, when the simplejson module is present, requests preferentially uses this module rather than the json module when executing, among other calls, Response.json().

Problem

Currently, the deprecated display_response function makes a call to response.json(), but then expects the exception, if any, to be a json exception, rather than a simplejson exception

This means that a simplejson exception, if thrown, is uncaught until it passes up to the caller of display_response, which includes json_responder.retrieve_response_from_Endpoint.

Proposal

Either simplejson exceptions should be caught, if it is possible that they will be thrown, or the possibility that they will be thrown should be entirely avoided.

@efeg efeg assigned efeg and mgrubent and unassigned efeg Sep 3, 2019
@efeg efeg added the correctness A condition affecting the proper functionality. label Sep 3, 2019
@efeg efeg closed this as completed in #928 Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correctness A condition affecting the proper functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants