Skip to content

Add allow_nan attribute to DefaultJSONProvider - #6116

Closed
Omacrow wants to merge 1 commit into
pallets:mainfrom
Omacrow:json-allow-nan
Closed

Add allow_nan attribute to DefaultJSONProvider#6116
Omacrow wants to merge 1 commit into
pallets:mainfrom
Omacrow:json-allow-nan

Conversation

@Omacrow

@Omacrow Omacrow commented Aug 1, 2026

Copy link
Copy Markdown

DefaultJSONProvider now exposes an allow_nan attribute (default True,
matching the existing json.dumps default), so applications can opt
into strict RFC 8259 output with app.json.allow_nan = False.

fixes #6114

DefaultJSONProvider now exposes an allow_nan attribute (default True,
matching the existing json.dumps default), so applications can opt
into strict RFC 8259 output with app.json.allow_nan = False.

Refs pallets#6114
@Omacrow

Omacrow commented Aug 1, 2026

Copy link
Copy Markdown
Author

The failing "Development Versions" check looks unrelated to this change
it's failing on a DeprecationWarning from Werkzeug's main branch
(parse_cache_control_header / parse_set_header) inside test_blueprints.py
and test_views.py, neither of which this PR touches.

@davidism

davidism commented Aug 1, 2026

Copy link
Copy Markdown
Member

Duplicate of #2832

@davidism davidism marked this as a duplicate of #2832 Aug 1, 2026
@davidism davidism closed this Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jsonify emits NaN and Infinity, which are not valid JSON

2 participants