[New-bugs-announce] [issue22005] datetime.__setstate__ fails decoding python2 pickle

Edward Oubrayrie report at bugs.python.org
Fri Jul 18 14:49:52 CEST 2014

New submission from Edward Oubrayrie:

pickle.loads raises a TypeError when calling the datetime constructor, (then a UnicodeEncodeError in the load_reduce function).

A short test program & the log, including dis output of both PY2 and PY3 pickles, are available in this gist; and extract on stackoverflow:

I am using pickle.dumps(reply, protocol=2) in PY2 
then pickle._loads(pickled, fix_imports=True, encoding='latin1') in PY3
(tried None and utf-8 without success)

Native cPickle loads decoding fails too, I am only using pure python's _loads for debugging.

Sorry if this is misguided (first time here)

components: Library (Lib)
messages: 223408
nosy: eddygeek
priority: normal
severity: normal
status: open
title: datetime.__setstate__ fails decoding python2 pickle
type: behavior
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list