]> granicus.if.org Git - python/commitdiff
Issue #23096: Pickle representation of floats with protocol 0 now is the same
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 15 Feb 2015 12:18:32 +0000 (14:18 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 15 Feb 2015 12:18:32 +0000 (14:18 +0200)
for both Python and C implementations.

Misc/NEWS
Modules/_pickle.c

index 4625134d278f3269f3f0e479c07d899a828d2455..9051e00b357e77212206e2a8fc70faf67b052baf 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #23096: Pickle representation of floats with protocol 0 now is the same
+  for both Python and C implementations.
+
 - Issue #19105: pprint now more efficiently uses free space at the right.
 
 - Issue #14910: Add allow_abbrev parameter to argparse.ArgumentParser. Patch by
index 7a234f1dfff5590dd129d39191bfbe74cbc4e96b..51e2f83ff8ffc6a46ec718dd3dee792b7606e46f 100644 (file)
@@ -1979,7 +1979,7 @@ save_float(PicklerObject *self, PyObject *obj)
         if (_Pickler_Write(self, &op, 1) < 0)
             goto done;
 
-        buf = PyOS_double_to_string(x, 'g', 17, 0, NULL);
+        buf = PyOS_double_to_string(x, 'r', 0, Py_DTSF_ADD_DOT_0, NULL);
         if (!buf) {
             PyErr_NoMemory();
             goto done;