[issue40633] json.dumps() should encode float number NaN to null

Eric V. Smith report at bugs.python.org
Fri May 15 09:57:20 EDT 2020


Eric V. Smith <eric at trueblade.com> added the comment:

Since this is documented behavior (https://docs.python.org/3.8/library/json.html#infinite-and-nan-number-values), we can't change it by default without breaking code.

What JavaScript JSON encoders and decoders specifically have a problem with this behavior? The documentation says "This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders.", so if there are encoders and decoders that it doesn't work with, that would be good to know.

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40633>
_______________________________________


More information about the Python-bugs-list mailing list