pickle broken: can't handle NaN or Infinity under win32

Grant Edwards grante at visi.com
Wed Jun 22 14:06:35 EDT 2005


On 2005-06-22, Scott David Daniels <Scott.Daniels at Acm.Org> wrote:

>> Fixing it is really quite trivial.  It takes less than a dozen
>> lines of code.  Just catch the exception and handle it.
>
> Since you know it is quite trivial, and I don't, why not
> submit a patch resolving this issue.  Be sure to include tests
> for all supported Python platforms.

I'm working on it.  I should have said it's trivial if you have
access to the platforms to be supported.  I've tested a fix
that supports pickle streams generated under Win32 and glibc.
That's using the "native" string representation of a NaN or
Inf.

A perhaps simpler approach would be to define a string
representation for Python to use for NaN and Inf.  Just because
something isn't defined by the C standard doesn't mean it can't
be defined by Python.

-- 
Grant Edwards                   grante             Yow!  I'm shaving!! I'M
                                  at               SHAVING!!
                               visi.com            



More information about the Python-list mailing list