diff options
-rw-r--r-- | Modules/_pickle.c | 2 | ||||
-rw-r--r-- | Python/marshal.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 20ab525..e9c4a76 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -1025,7 +1025,7 @@ save_float(PicklerObject *self, PyObject *obj) if (pickler_write(self, &op, 1) < 0) goto done; - buf = PyOS_double_to_string(x, 'r', 0, 0, NULL); + buf = PyOS_double_to_string(x, 'g', 17, 0, NULL); if (!buf) { PyErr_NoMemory(); goto done; diff --git a/Python/marshal.c b/Python/marshal.c index 0d55132..911d2e1 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -237,7 +237,7 @@ w_object(PyObject *v, WFILE *p) } else { char *buf = PyOS_double_to_string(PyFloat_AS_DOUBLE(v), - 'r', 0, 0, NULL); + 'g', 17, 0, NULL); if (!buf) return; n = strlen(buf); @@ -269,7 +269,7 @@ w_object(PyObject *v, WFILE *p) char *buf; w_byte(TYPE_COMPLEX, p); buf = PyOS_double_to_string(PyComplex_RealAsDouble(v), - 'r', 0, 0, NULL); + 'g', 17, 0, NULL); if (!buf) return; n = strlen(buf); @@ -277,7 +277,7 @@ w_object(PyObject *v, WFILE *p) w_string(buf, (int)n, p); PyMem_Free(buf); buf = PyOS_double_to_string(PyComplex_ImagAsDouble(v), - 'r', 0, 0, NULL); + 'g', 17, 0, NULL); if (!buf) return; n = strlen(buf); |