From: Ezio Melotti Date: Mon, 21 May 2012 23:49:06 +0000 (-0600) Subject: #14875: Use float('inf') instead of float('1e66666') in the json module. X-Git-Tag: v3.3.0a4~97^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=898d51da4d2db44d71809ee84089877f5c08f3fd;p=python #14875: Use float('inf') instead of float('1e66666') in the json module. --- diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py index 4b214eb60e..75b7f494b3 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 1540478d9c..ec5cd9878e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -67,6 +67,8 @@ Core and Builtins Library ------- +- Issue #14875: Use float('inf') instead of float('1e66666') in the json module. + - Issue #14426: Correct the Date format in Expires attribute of Set-Cookie Header in Cookie.py.