Dumping a float with cPickle produces a result which is locale-dependent. This causes problems when trying to load the dump under a different locale (the regular pickle module is not affected by this bug). IMHO, the dump should be locale-independent to ensure portability. See the attached file for a sample session log showing the behaviour of both pickle and cPickle under C and ca_ES.UTF-8 locales (Catalan uses a comma to separate the integer and decimal part).
Logged In: YES user_id=1064183 The problem seems to be in save_float() in the cPickle.c module. It uses PyOS_snprintf() to dump floats, but it is locale-dependent. Fortunately, the PyOS_ascii_formatd() function can be used. The attached patch seems to fix the problem, and pickling tests run OK. It would be nice to see this patch applied to 2.4 also. (BTW, I meant PEP 331 in the previous comment, not 311, sorry.)