Merged revisions 68903,68906 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines

  Issue #1672332: Fix unpickling of subnormal floats, which was raising
  ValueError on some platforms as a result of the platform strtod setting
  errno on underflow.
........
  r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines

  Issue #3657: fix occasional test_pickletools failures.
........
This commit is contained in:
Mark Dickinson 2009-01-24 21:46:33 +00:00
parent 3dfe55b6ff
commit cddcf444b2
4 changed files with 20 additions and 6 deletions

View file

@ -2958,7 +2958,8 @@ load_float(UnpicklerObject *self)
errno = 0;
d = PyOS_ascii_strtod(s, &endptr);
if (errno || (endptr[0] != '\n') || (endptr[1] != '\0')) {
if ((errno == ERANGE && !(fabs(d) <= 1.0)) ||
(endptr[0] != '\n') || (endptr[1] != '\0')) {
PyErr_SetString(PyExc_ValueError, "could not convert string to float");
return -1;
}