472,951 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 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 16203
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeff | last post by:
The pickle module is so powerful. It has probably saved me thousands and thousands of lines of code over the years. It alone is enough to pursuede me to use Python in many instances. However,...
7
by: Antoon Pardon | last post by:
I'm writing a little game, a gridler application, where you can turn pixmaps into puzzle's and try to solve them. I already have the data structure for such a puzzle worked out, one of the...
2
by: Tomasz Lisowski | last post by:
The documentation says, that the output from pickle.dumps() consists of "printable ASCII" characters. Does it mean the range from ASCII 32 to 127? Or the expected character range is different? ...
10
by: Justin Straube | last post by:
Hello, Im trying to compile a script with py2exe. The pickle module is causing the program to give an error. Traceback (most recent call last): File "SETIstat.pyw", line 330, in ? File...
12
by: Aki Niimura | last post by:
Hello everyone, I started to use pickle to store the latest user settings for the tool I wrote. It writes out a pickled text file when it terminates and it restores the settings when it starts....
28
by: Grant Edwards | last post by:
I finally figured out why one of my apps sometimes fails under Win32 when it always works fine under Linux: Under Win32, the pickle module only works with a subset of floating point values. In...
6
by: Bart Ogryczak | last post by:
Hello, I´ve got this problem with pickle, it seems it doesn´t handle correctly infinite values (nor does Python return overflow/underflow error). What could I do about it? Example code: <type...
10
by: est | last post by:
>>import md5 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python25\lib\pickle.py", line 1366, in dumps Pickler(file, protocol).dump(obj) File...
4
by: Lie Ryan | last post by:
On Thu, 09 Oct 2008 13:26:17 +0100, Orestis Markou wrote: in python 2.6, ast.literal_eval may be used to replace eval() for literals. It does not accepts statements and function calls, i.e.: ...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.