Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c86ca26

Browse files
Issue #23096: Pickle representation of floats with protocol 0 now is the same
for both Python and C implementations.
1 parent d362c21 commit c86ca26

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Core and Builtins
1313
Library
1414
-------
1515

16+
- Issue #23096: Pickle representation of floats with protocol 0 now is the same
17+
for both Python and C implementations.
18+
1619
- Issue #19105: pprint now more efficiently uses free space at the right.
1720

1821
- Issue #14910: Add allow_abbrev parameter to argparse.ArgumentParser. Patch by

Modules/_pickle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ save_float(PicklerObject *self, PyObject *obj)
19791979
if (_Pickler_Write(self, &op, 1) < 0)
19801980
goto done;
19811981

1982-
buf = PyOS_double_to_string(x, 'g', 17, 0, NULL);
1982+
buf = PyOS_double_to_string(x, 'r', 0, Py_DTSF_ADD_DOT_0, NULL);
19831983
if (!buf) {
19841984
PyErr_NoMemory();
19851985
goto done;

0 commit comments

Comments
 (0)