diff -r 94710cbcac47 Lib/json/encoder.py --- a/Lib/json/encoder.py Thu Sep 01 13:55:33 2016 -0400 +++ b/Lib/json/encoder.py Thu Sep 01 14:46:57 2016 -0500 @@ -221,7 +221,7 @@ _encoder = encode_basestring def floatstr(o, allow_nan=self.allow_nan, - _repr=float.__repr__, _inf=INFINITY, _neginf=-INFINITY): + _repr=float.__str__, _inf=INFINITY, _neginf=-INFINITY): # Check for specials. Note that this type of test is processor # and/or platform-specific, so do tests which don't depend on the # internals. @@ -238,7 +238,7 @@ if not allow_nan: raise ValueError( "Out of range float values are not JSON compliant: " + - repr(o)) + str(o)) return text diff -r 94710cbcac47 Modules/_json.c --- a/Modules/_json.c Thu Sep 01 13:55:33 2016 -0400 +++ b/Modules/_json.c Thu Sep 01 14:46:57 2016 -0500 @@ -1465,7 +1465,7 @@ return PyUnicode_FromString("NaN"); } } - return PyFloat_Type.tp_repr(obj); + return PyFloat_Type.tp_str(obj); } static PyObject *