You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module does not comply with the RFC in a strict fashion, implementing some extensions that are valid JavaScript but not valid JSON. In particular:
Infinite and NaN number values are accepted and output;
This is a problem because JavaScript's JSON parser will consider values such as Infinity (note this is not a string) as invalid.
A custom JSONEncoder can be used to address these issues, but the question remains to what these values should be serialised. What format will allow JavaScript to properly interpret them? Oddly enough, JS itself serialises Infinity to null so that's not an answer.
The text was updated successfully, but these errors were encountered:
Sorry for the late response. I think tracers.py should (still) simply serialize Infinity and NaN to null so that it behaves the same as tracers.js does.
Quote from Python's json module documentation:
This is a problem because JavaScript's JSON parser will consider values such as
Infinity
(note this is not a string) as invalid.A custom
JSONEncoder
can be used to address these issues, but the question remains to what these values should be serialised. What format will allow JavaScript to properly interpret them? Oddly enough, JS itself serialisesInfinity
tonull
so that's not an answer.The text was updated successfully, but these errors were encountered: