473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 16244
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.: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.