471,330 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

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
Sep 11 '07 #1
2 16008
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
Sep 11 '07 #2
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 -------------

Sep 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jeff | last post: by
7 posts views Thread by Antoon Pardon | last post: by
2 posts views Thread by Tomasz Lisowski | last post: by
10 posts views Thread by Justin Straube | last post: by
12 posts views Thread by Aki Niimura | last post: by
28 posts views Thread by Grant Edwards | last post: by
6 posts views Thread by Bart Ogryczak | last post: by
10 posts views Thread by est | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.