[New-bugs-announce] [issue29998] Pickling and copying ImportError doesn't preserve name and path

Serhiy Storchaka report at bugs.python.org
Wed Apr 5 16:34:36 EDT 2017


New submission from Serhiy Storchaka:

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.

----------
components: Interpreter Core
messages: 291194
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Pickling and copying ImportError doesn't preserve name and path
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

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


More information about the New-bugs-announce mailing list