New submission from Serhiy Storchaka: ImportError.__init__ sets only specified attributes ("msg", "name" or "path"), and left not explicitly specified attributes unchanged.
>>> err = ImportError('test', name='name') >>> err.args, err.msg, err.name, err.path (('test',), 'test', 'name', None) >>> err.__init__(path='path') >>> err.args, err.msg, err.name, err.path ((), 'test', 'name', 'path') In above example err.__init__(path='path') sets attributes "args" and "path", but not "msg" and "name". I'm not sure whether can this be considered as a bug. ---------- components: Interpreter Core messages: 277533 nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka priority: normal severity: normal status: open title: ImportError.__init__ doesn't reset not specified exception attributes versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28289> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com