Message327

Author mrblah
Recipients
Date 2001-06-28.21:39:05
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
It appears that newlines aren't escaped properly when 
you try to pickle a string in text mode (I actually 
had strings inside a list and was pickling the list). 
When you try to unpickle the data, it blows up.

To duplicate, try something like:

  import pickle
  s1="line1\nline2\nline3"
  s2="line4\nline5\nline6"
  l = [s1, s2]
  p = pickle.dumps(l)   # newlines won't be escaped
  l2 = pickle.loads(p)  # blows up

Pickling in binary mode seems to work fine. ie:
  ...
  p = pickle.dumps(l, 1)
  l2 = pickle.loads(p)  # works correctly

History
Date User Action Args
2008-02-20 17:16:51adminlinkissue437215 messages
2008-02-20 17:16:51admincreate