[New-bugs-announce] [issue26105] Python JSON module doesn't actually produce JSON

Connor Wolf report at bugs.python.org
Wed Jan 13 18:15:13 EST 2016


New submission from Connor Wolf:

The Python library JSON library doesn't emit JSON by default.

Basically, `json.dumps(float('nan'))` produces something that kind of looks like json, but isn't (specifically, `'NaN'`). Valid JSON must be `null`.

JSON *does not allow `NaN`, `infinity`, or `-infinity`. 

`json.dump[s]` has the parameter `allow_nan`, but it's `False` by default, so basically it's not actually JSON by default.

The default for emitting JSON should actually emit JSON. `allow_nan` must be `True` by default.

----------
components: Library (Lib)
messages: 258179
nosy: Connor.Wolf
priority: normal
severity: normal
status: open
title: Python JSON module doesn't actually produce JSON
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26105>
_______________________________________


More information about the New-bugs-announce mailing list