ValueError: insecure string pickle ? - Python
This is a discussion on ValueError: insecure string pickle ? - Python ; cPickle.loads raised "ValueError: insecure string pickle".
The error is from a log file and I cannot reproduce it (quickly).
What can be the cause for that error?
Robert...
-
ValueError: insecure string pickle ?
cPickle.loads raised "ValueError: insecure string pickle".
The error is from a log file and I cannot reproduce it (quickly).
What can be the cause for that error?
Robert
-
Re: ValueError: insecure string pickle ?
Am Tue, 11 Sep 2007 17:19:36 +0200 schrieb robert:
> cPickle.loads raised "ValueError: insecure string pickle".
> The error is from a log file and I cannot reproduce it (quickly).
> What can be the cause for that error?
A corrupted pickle. The error is raised if a string in the dump does not
both start and end with " or '. One way to provoke the error:
>>> from cPickle import loads, dumps
>>> s = dumps("abc")
>>> s
"S'abc'\np1\n." # that's what it should look like
>>> loads("S'abc") # but make it too short
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: insecure string pickle
Peter
-
Re: ValueError: insecure string pickle ?
robert wrote:
> cPickle.loads raised "ValueError: insecure string pickle".
> The error is from a log file and I cannot reproduce it (quickly).
> What can be the cause for that error?
>
> Robert
Make sure that your pickle files are being read and written in binary
mode ("rb" and "wb" as the second argument to open()).
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
Similar Threads
-
By Application Development in forum Python
Replies: 1
Last Post: 11-01-2007, 08:34 PM
-
By Application Development in forum Python
Replies: 9
Last Post: 09-28-2007, 05:26 AM
-
By Application Development in forum Python
Replies: 3
Last Post: 09-27-2007, 08:23 PM
-
By Application Development in forum Python
Replies: 3
Last Post: 09-09-2007, 08:54 PM
-
By Application Development in forum Perl
Replies: 0
Last Post: 08-13-2003, 10:22 AM