(original) (raw)

changeset: 77099:c13066f752a8 branch: 2.7 parent: 77087:4973c90ce9e6 user: Ezio Melotti ezio.melotti@gmail.com date: Mon May 21 17:46:55 2012 -0600 files: Lib/json/encoder.py Misc/NEWS description: #14875: Use float('inf') instead of float('1e66666') in the json module. diff -r 4973c90ce9e6 -r c13066f752a8 Lib/json/encoder.py --- a/Lib/json/encoder.py Sun May 20 15:35:00 2012 +0100 +++ b/Lib/json/encoder.py Mon May 21 17:46:55 2012 -0600 @@ -27,8 +27,7 @@ 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 -r 4973c90ce9e6 -r c13066f752a8 Misc/NEWS --- a/Misc/NEWS Sun May 20 15:35:00 2012 +0100 +++ b/Misc/NEWS Mon May 21 17:46:55 2012 -0600 @@ -64,6 +64,8 @@ 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 @@ - 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(). /ezio.melotti@gmail.com