]> granicus.if.org Git - python/commitdiff
#14875: Use float('inf') instead of float('1e66666') in the json module.
authorEzio Melotti <ezio.melotti@gmail.com>
Mon, 21 May 2012 23:46:55 +0000 (17:46 -0600)
committerEzio Melotti <ezio.melotti@gmail.com>
Mon, 21 May 2012 23:46:55 +0000 (17:46 -0600)
Lib/json/encoder.py
Misc/NEWS

index 906c46216aa99d77062f114e25940bd9952afb85..b0d745b5dc059acac5bd6a0af5b78353855e93eb 100644 (file)
@@ -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):
index d9faea53bad8682124f5f10920c4d112121bedf8..de0ec5defabd6a6107b65acf6e199a15188df50a 100644 (file)
--- 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().