[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +1040

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dcb39d3ba67a by Serhiy Storchaka in branch 'default':
Issue #28289: ImportError.__init__ now resets not specified attributes.
https://hg.python.org/cpython/rev/dcb39d3ba67a

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Brett.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Brett Cannon

Brett Cannon added the comment:

And I say don't worry about backporting.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Brett Cannon

Brett Cannon added the comment:

Patch LGTM.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a simple patch.

But I'm not sure that this is a bug.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file44848/importerror-reset-attributes.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Brett Cannon

Brett Cannon added the comment:

I think it's a bug, but a low priority one.

--
priority: normal -> low

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-27 Thread Serhiy Storchaka

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com