Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Use strict float handling in JSON functions#5265
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
STRICT_JSON controls the renderer & parser behavior on whether or notto accept non-standard float values (NaN, Infinity).
ContributorAuthor
rpkilby commentedJul 10, 2017
@sbchisholm,@andyneff - does this provide the expected behavior? |
| @@ -0,0 +1,33 @@ | |||
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Worth a docstring here to highlight why we have this module.
Contributor
lovelydinosaur commentedJul 11, 2017
This is ace. Nice work@rpkilby! |
lovelydinosaur approved these changesJul 12, 2017
Contributor
lovelydinosaur commentedJul 12, 2017
Looks great. Deferring to 3.7.0. |
6 tasks
carltongibson pushed a commit that referenced this pull requestOct 6, 2017
* Set version number for 3.7.0 release* Rename release notes sectionMoved issue links to top for easier access.(Can move back later)* Add release note for#5273* Add release note for#5440* Add release note for#5265Strict JSON handling* Add release note for#5250* Add release notes for#5170* Add release notes for#5443* Add release notes for#5448* Add release notes for#5452* Add release not for#5342* Add release notes for 5454* Add release notes for#5058 ᕑRemove Django 1.8 & 1.9 from README and setup.py* Release notes for merged 3.6.5 milestone ticketsTickets migrated to 3.7.0 milestone.* Add release notes for#5469* Add release notes from AM 2ndOct* Add final changes to the release notes.* Add date and milestone linkMove issue links back to bottom.* Update translations from transifex* Begin releae anouncement* Add release note for#5482* 3.7 release announcement & related docs.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolve#4918,fix#5235. The important bits that I gathered from the discussion were:
JSONField) may not be compatible with the extended float values (Infinity,NaN). Incompatible values should raise an exception.This PR does the following:
rest_framework.utils.jsonmodule that defaults to strict JSON encoding/decoding.rest_framework.utils.json, so they obey the stricter behavior.settings.STRICT_JSON, which controls the strictness ofJSONParser&JSONRenderer. This defaults toTrue, but users can revert to the old extended behavior by setting this toFalse