[Baypiggies] pickle misbehavior

Vikram K kpguy1975 at gmail.com
Thu Dec 16 20:38:32 CET 2010


I have two files A and B. In A i am doing the pickling and these are the
relevant lines:

outf = open('totalpepfinalpickled.txt', 'wb')
pickle.dump(trypticprotrev,outf)

The variable being pickled if of type dict.

In B i am unpickling and these are the relevant lines:
f = open ('totalpepfinalpickled.txt')

x = pickle.load(f)

A runs fine on execution. On running B, i got the following error:

Traceback (most recent call last):
  File "C:\Users\K\filtertest2.py", line 46, in <module>
    x = pickle.load(f)
ValueError: insecure string pickle
>>>

I went back to A and executed it twice. Then i again executed B and B ran
fine and gave expected results.

Then i executed A using a much larger data set. Now when i executed B i
obtained unexpected results which seem erroneous to me.

My solution was to put everything in one file and bypass pickle altogether.
But any insights about this error message would be much appreciated. Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20101216/39d6f1b5/attachment.html>


More information about the Baypiggies mailing list