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 serhiy.storchaka
Recipients alexandre.vassalotti, brett.cannon, diekhans, eric.snow, ncoghlan, serhiy.storchaka
Date 2017-02-08.11:55:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486554909.42.0.680609972535.issue29466@psf.upfronthosting.co.za>
In-reply-to
Content
True. Attributes __context__, __cause__ and __traceback__ are not pickled. The traceback objects are even not pickleable.

What is worse, some other non-special attributes are lost during pickling. For example name and path attributes of ImportError.

>>> try: import foo
... except Exception as ex: exc = ex
... 
>>> exc.name
'foo'
>>> exc.__reduce__()
(<class 'ModuleNotFoundError'>, ("No module named 'foo'",), {})

Or the value attribute of StopIteration if it was not passed to the constructor.

>>> exc = StopIteration()
>>> exc.value = 42
>>> exc.__reduce__()
(<class 'StopIteration'>, (), {})
History
Date User Action Args
2017-02-08 11:55:09serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, ncoghlan, diekhans, alexandre.vassalotti, eric.snow
2017-02-08 11:55:09serhiy.storchakasetmessageid: <1486554909.42.0.680609972535.issue29466@psf.upfronthosting.co.za>
2017-02-08 11:55:09serhiy.storchakalinkissue29466 messages
2017-02-08 11:55:09serhiy.storchakacreate