Bugs item #1188175, was opened at 2005-04-22 16:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1188175&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Heiko Selber (drhok)
Assigned to: Nobody/Anonymous (nobody)
Summary: Pickle with HIGHEST_PROTOCOL "ord() expected..."

Initial Comment:
A Python script that I wrote contains a tree-like data 
structure that cannot be unpickled when pickled with 
protocol==-1 (or 2).

I attached the smallest example I could find.

If run with pickle, the result is:

Traceback (most recent call last):
  File "D:\src\misc\CDROM\python\pickletest.py", line 
68, in ?
    tree=load( f )
  File "C:\Python23\lib\pickle.py", line 1390, in load
    return Unpickler(file).load()
  File "C:\Python23\lib\pickle.py", line 872, in load
    dispatch[key](self)
  File "C:\Python23\lib\pickle.py", line 1189, in 
load_binput
    i = ord(self.read(1))
TypeError: ord() expected a character, but string of 
length 0 found

But with cPickle, the result is:

Traceback (most recent call last):
  File "D:\src\misc\CDROM\python\pickletest.py", line 
68, in ?
    tree=load( f )
EOFError

Small changes in the datastructure lead to different 
results: try changing the line
if level<4:
to
if level<1:

Now cPickle works, but not pickle.

This happens with Python 2.3.3 and 2.3.5 on Windows 
XP.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1188175&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to