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 brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
Date 2017-04-05.20:34:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za>
In-reply-to
Content
Pickling and copying ImportError doesn't preserve name and path attributes.

>>> import copy, pickle
>>> e = ImportError('test', name='n', path='p')
>>> e.name
'n'
>>> e.path
'p'
>>> e2 = pickle.loads(pickle.dumps(e, 4))
>>> e2.name
>>> e2.path
>>> e2 = copy.copy(e)
>>> e2.name
>>> e2.path

Proposed patch fixes this.
History
Date User Action Args
2017-04-05 20:34:36serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, ncoghlan, eric.snow
2017-04-05 20:34:36serhiy.storchakasetmessageid: <1491424476.08.0.673236809486.issue29998@psf.upfronthosting.co.za>
2017-04-05 20:34:35serhiy.storchakalinkissue29998 messages
2017-04-05 20:34:35serhiy.storchakacreate