Francesc Alted wrote:
> A Friday 18 December 2009 20:47:16 Anthony Foglia escrigué:
>> I'm still trying to track down the errors I had earlier this week, but
>> in the meantime, we've found a bigger one. PyTables crashes when
>> opening a file with an attribute of the root node with the value "0.".
>> It can write attributes like that fine, but when it tries to read
>> there's a crash.
>>
>> I've tracked the problem down to a bug in Python 2.6.4's cPickle
>> module. Until Python fixes the bug (it might be fixed already in 2.7, I
>> don't know), would it make sense to add a parameter to shut off
>> automatic depickling of attributes?
[ PyTables example omitted]
>> $ ipython
>> In [1]: import cPickle
>>
>> In [2]: cPickle.loads("0.")
>> Segmentation fault (core dumped)
>
> Mmh, I cannot reproduce the bug with python 2.6.1:
>
> In [2]: import cPickle
>
> In [3]: cPickle.loads("0.")
> ---------------------------------------------------------------------------
> UnpicklingError Traceback (most recent call last)
>
> /home/faltet/PyTables/pytables/trunk/<ipython console> in <module>()
>
> UnpicklingError: unpickling stack underflow
>
> which is the expected error. In fact, your pytables example works well for
> me. That's weird...
It was introduced in a version after 2.6.1, but it's definitely there.
Here's the bug report I filed, and not only was it confirmed for
Python 2.7, 3.1, and 3.2 as well, but it's a symptom of a previously
known bug.
http://bugs.python.org/issue7542
http://bugs.python.org/issue7455
According to the second link, the bug was introduced in May, after
2.6.1 came out.
Luckily for us, these were newly generated files, so we can patch them
and change the C++ code to write "0.0" and not "0" or "0.0". But still
a parameter might be useful, not only would it give users a way to avoid
this bug, but it should save the time it takes PyTables to guess whether
an attribute is a pickled object.
--
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users