mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.
On the way, add a decorator to test_support to facilitate running single test functions in different locales with automatic cleanup.
This commit is contained in:
parent
44a118af50
commit
de9b624fb9
6 changed files with 67 additions and 53 deletions
|
@ -1151,7 +1151,9 @@ save_float(Picklerobject *self, PyObject *args)
|
|||
else {
|
||||
char c_str[250];
|
||||
c_str[0] = FLOAT;
|
||||
PyOS_snprintf(c_str + 1, sizeof(c_str) - 1, "%.17g\n", x);
|
||||
PyOS_ascii_formatd(c_str + 1, sizeof(c_str) - 2, "%.17g", x);
|
||||
/* Extend the formatted string with a newline character */
|
||||
strcat(c_str, "\n");
|
||||
|
||||
if (self->write_func(self, c_str, strlen(c_str)) < 0)
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue