summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-05-21 23:46:55 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-05-21 23:46:55 (GMT)
commited8cf7a543b3ebe2d61c16d0f87e60029fd2c478 (patch)
tree0dabfff15936e7d3bce7e2683bd07a2c677c7fb1
parent5f045ea4409ce58c6c886cb2922c88ae73ee9ce6 (diff)
downloadcpython-ed8cf7a543b3ebe2d61c16d0f87e60029fd2c478.zip
cpython-ed8cf7a543b3ebe2d61c16d0f87e60029fd2c478.tar.gz
cpython-ed8cf7a543b3ebe2d61c16d0f87e60029fd2c478.tar.bz2
#14875: Use float('inf') instead of float('1e66666') in the json module.
-rw-r--r--Lib/json/encoder.py3
-rw-r--r--Misc/NEWS4
2 files changed, 4 insertions, 3 deletions
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index 906c462..b0d745b 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -27,8 +27,7 @@ for i in range(0x20):
ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i))
#ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))
-# Assume this produces an infinity on all machines (probably not guaranteed)
-INFINITY = float('1e66666')
+INFINITY = float('inf')
FLOAT_REPR = repr
def encode_basestring(s):
diff --git a/Misc/NEWS b/Misc/NEWS
index d9faea5..de0ec5d 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -64,6 +64,8 @@ Core and Builtins
Library
-------
+- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
+
- Issue #14572: Prevent build failures with pre-3.5.0 versions of
sqlite3, such as was shipped with Centos 5 and Mac OS X 10.4.
@@ -119,7 +121,7 @@ Library
- Issue #13684: Fix httplib tunnel issue of infinite loops for certain sites
which send EOF without trailing \r\n.
-
+
- Issue #14308: Fix an exception when a "dummy" thread is in the threading
module's active list after a fork().