pickle broken: can't handle NaN or Infinity under win32
Scott David Daniels
Scott.Daniels at Acm.Org
Wed Jun 22 13:58:14 EDT 2005
Grant Edwards wrote:
> On 2005-06-22, Scott David Daniels <Scott.Daniels at Acm.Org> wrote:
>>>...Under Win32, the pickle module only works with a subset of
>>> floating point values. In particular ... infinity or nan ...
>>
>>There is no completely portable way to do this.
>
> Python deals with all sorts of problems for which there is no
> completely portable solution. Remember: "practicality beats purity."
>
>>Any single platform can have a solution, but (since the C
>>standards don't address how NaNs and Infs are represented)
>>there is not a good portable way to do the pickle / unpickle.
> ...
> 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.
--Scott David Daniels
Scott.Daniels at Acm.Org
More information about the Python-list
mailing list