Message79150
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.) |
|
Date |
User |
Action |
Args |
2009-01-05 14:07:16 | mark.dickinson | set | recipients:
+ mark.dickinson, loewis, georg.brandl, sgala, oneg |
2009-01-05 14:07:16 | mark.dickinson | set | messageid: <1231164436.78.0.749780931301.issue1672332@psf.upfronthosting.co.za> |
2009-01-05 14:07:15 | mark.dickinson | link | issue1672332 messages |
2009-01-05 14:07:14 | mark.dickinson | create | |
|