Mark Dickinson <dicki...@gmail.com> added the comment:

The problem comes down to the platform strtod:  on some systems,
strtod sets errno to ERANGE on underflow.  The load_float function in
Modules/cPickle.c calls PyOS_ascii_strtod and then raises ValueError
if that call sets errno.

I suggest replacing the call to PyOS_ascii_strtod with a call to
PyFloat_FromString instead.  This would make cPickle behave identically
to pickle, and would also fix the problem on Windows where 1e-310 is
dumped as 0.0.  (PyFloat_FromString goes out of its way to use atof 
instead of strtod to deal with this case.)

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1672332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to