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.
Created on 2015年09月16日 14:48 by Sebastian Kreft, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg250850 - (view) | Author: Sebastian Kreft (Sebastian Kreft) | Date: 2015年09月16日 14:48 | |
ImportError now supports the keyword arguments name and path. However, when passing invalid keyword arguments, the reported error is misleading, as shown below.
In [1]: ImportError('lib', name='lib')
Out[1]: ImportError('lib')
In [2]: ImportError('lib', name='lib', foo='foo')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-5af12651187f> in <module>()
----> 1 ImportError('lib', name='lib', foo='foo')
TypeError: ImportError does not take keyword arguments
|
|||
| msg250854 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2015年09月16日 16:34 | |
I bet it's because of https://hg.python.org/cpython/file/tip/Objects/exceptions.c#l64 which is called by https://hg.python.org/cpython/file/tip/Objects/exceptions.c#l643 . |
|||
| msg250856 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2015年09月16日 17:20 | |
Thanks for the report. This is a duplicate of issue 21578. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:21 | admin | set | github: 69329 |
| 2015年09月16日 17:20:42 | berker.peksag | set | status: open -> closed superseder: Misleading error message when ImportError called with invalid keyword args nosy: + berker.peksag messages: + msg250856 resolution: duplicate stage: resolved |
| 2015年09月16日 16:34:35 | brett.cannon | set | nosy:
+ brett.cannon messages: + msg250854 components: + Interpreter Core type: enhancement |
| 2015年09月16日 14:48:47 | Sebastian Kreft | create | |