[issue12687] Python 3.2 fails to load protocol 0 pickle

Vinay Sajip report at bugs.python.org
Wed Aug 3 11:55:15 CEST 2011


New submission from Vinay Sajip <vinay_sajip at yahoo.co.uk>:

The attached 2.x-written protocol 0 pickle file cannot be loaded by Python 3.2 or 3.3, though it loads successfully in 2.x.

Code used to load:

data = pickle.load(open('test.bin', 'rb'))

Error:

Traceback (most recent call last):
  File "load_it.py", line 4, in <module>
    data = pickle.load(open(sys.argv[1], 'rb'))
ValueError: invalid literal for int() with base 10: "273\n(g8\nS'uint64_t'\np274\ntp275\nsS'Module'\np276\n(g45\n(g39\nS'objc_module'\np277\nNtp278\ntp279\nsS'mach_msg_trailer_size_t'\np280\n(g4\ng190\ntp281\nsS'uint_fast16_t'\np282\n(g8\nS'uint16_t'\np283\ntp284\nsS'pthread_m"

The failure occurs on Ubuntu Natty. This does not appear to be the same issue as #6137.

AFAIK the data contains no classes: just dictionaries, tuples, lists, strings and numbers.

----------
components: Library (Lib)
files: test.bin
messages: 141602
nosy: alexandre.vassalotti, pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: Python 3.2 fails to load protocol 0 pickle
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22831/test.bin

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12687>
_______________________________________


More information about the Python-bugs-list mailing list