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...

+ Reply to Thread
Results 1 to 3 of 3

ValueError: insecure string pickle ?

  1. Default 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

  2. Default 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

  3. Default 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 -------------


+ Reply to Thread

Similar Threads

  1. ValueError: invalid \x escape
    By Application Development in forum Python
    Replies: 1
    Last Post: 11-01-2007, 08:34 PM
  2. ValueError: too many values to unpack,>>>
    By Application Development in forum Python
    Replies: 9
    Last Post: 09-28-2007, 05:26 AM
  3. ValueError: too many values to unpack
    By Application Development in forum Python
    Replies: 3
    Last Post: 09-27-2007, 08:23 PM
  4. MySQLdb: ValueError Something Stupid
    By Application Development in forum Python
    Replies: 3
    Last Post: 09-09-2007, 08:54 PM
  5. Help untaining the command. Insecure dependency in `` ... setuid
    By Application Development in forum Perl
    Replies: 0
    Last Post: 08-13-2003, 10:22 AM