This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author doerwalter
Recipients doerwalter
Date 2013-11-29.15:49:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1385740154.87.0.494742260047.issue19834@psf.upfronthosting.co.za>
In-reply-to
Content
Exception objects that have been pickled with Python 2 can not be unpickled with Python 3, even when fix_imports=True is specified:

  $ python2.7
  Python 2.7.2 (default, Aug 30 2011, 11:04:13)
  [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import pickle
  >>> pickle.dumps(StopIteration())
  'cexceptions\nStopIteration\np0\n(tRp1\n.'
  >>>
  $ python3.3
  Python 3.3.2 (default, Nov 14 2013, 12:22:14)
  [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import pickle
  >>> pickle.loads(b'cexceptions\nStopIteration\np0\n(tRp1\n.', fix_imports=True)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  ImportError: No module named 'exceptions'
  >>>

Adding an entry "exceptions": "builtins" to _compat_pickle.IMPORT_MAPPING seems to fix the problem.
History
Date User Action Args
2013-11-29 15:49:14doerwaltersetrecipients: + doerwalter
2013-11-29 15:49:14doerwaltersetmessageid: <1385740154.87.0.494742260047.issue19834@psf.upfronthosting.co.za>
2013-11-29 15:49:14doerwalterlinkissue19834 messages
2013-11-29 15:49:14doerwaltercreate