Issue 18342: Use the repr of a module name for ImportError in ceval.c (original ) (raw )Created on 2013-07-01 16:33 by brett.cannon , last changed 2022-04-11 14:57 by admin . This issue is now closed .
Messages (10)
msg192138 - (view)
Author: Brett Cannon (brett.cannon) *
Date: 2013-07-01 16:33
>>> from re import bogus Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: cannot import name bogus Should have 'bogus' using the repr to match the other cases of ModuleNotFoundError
msg192397 - (view)
Author: Tomasz Maćkowiak (kurazu) *
Date: 2013-07-06 09:58
Attaching a test case and a patch for formatting the module name with PyObject_Repr() not PyObject_Str().
msg192403 - (view)
Author: Tomasz Maćkowiak (kurazu) *
Date: 2013-07-06 10:20
Attaching a modified patch with assertRaisesRegexp used.
msg192419 - (view)
Author: STINNER Victor (vstinner) *
Date: 2013-07-06 11:50
The patch looks good to me. Just a minor nit: you should add ^ to the beginning of the regex. 2013/7/6 Tomasz Maćkowiak <report@bugs.python.org >: > > Tomasz Maćkowiak added the comment: > > Attaching a modified patch with assertRaisesRegexp used. > > ---------- > Added file: http://bugs.python.org/file30796/bug18342_2.patch > > _______________________________________ > Python tracker <report@bugs.python.org > > <http://bugs.python.org/issue18342 > > _______________________________________
msg192421 - (view)
Author: Tomasz Maćkowiak (kurazu) *
Date: 2013-07-06 12:04
Attached a corrected patch with regexps modified.
msg192475 - (view)
Author: Brett Cannon (brett.cannon) *
Date: 2013-07-06 17:36
Tomasz, can you sign the contributor agreement (http://python.org/psf/contrib/contrib-form/ ) so we can commit your code?
msg192485 - (view)
Author: Tomasz Maćkowiak (kurazu) *
Date: 2013-07-06 20:17
Signed.
msg192540 - (view)
Author: Tomasz Maćkowiak (kurazu) *
Date: 2013-07-07 11:16
Attached patch with renamed test methods (as per Brett's review).
msg192946 - (view)
Author: Roundup Robot (python-dev)
Date: 2013-07-12 15:22
New changeset c3f9292c8efe by Brett Cannon in branch 'default': Issue #18342 : Use the repr of a module name for ``from ... import http://hg.python.org/cpython/rev/c3f9292c8efe
msg192947 - (view)
Author: Brett Cannon (brett.cannon) *
Date: 2013-07-12 15:23
Patch is in (only moved the tests to a different class) and added Tomasz to the ACKS file. Thanks for the patch!
History
Date
User
Action
Args
2022-04-11 14:57:47
admin
set
github: 62542
2013-07-12 15:23:24
brett.cannon
set
status: open -> closedresolution: fixedmessages: + stage: needs patch -> resolved
2013-07-12 15:22:36
python-dev
set
nosy: + python-dev messages: +
2013-07-12 14:51:37
brett.cannon
set
title: Use the repr of a module name for ModuleNotFoundError in ceval.c -> Use the repr of a module name for ImportError in ceval.c
2013-07-07 11:16:07
kurazu
set
files: + bug18342_4.patch messages: +
2013-07-06 20:17:03
kurazu
set
messages: +
2013-07-06 17:36:31
brett.cannon
set
messages: +
2013-07-06 12:04:08
kurazu
set
files: + bug18342_3.patch messages: +
2013-07-06 11:50:55
vstinner
set
messages: +
2013-07-06 10:20:34
kurazu
set
files: + bug18342_2.patch messages: +
2013-07-06 09:58:32
kurazu
set
files: + bug18342.patch nosy: + kurazu messages: + keywords: + patch
2013-07-03 23:08:38
eric.snow
set
nosy: + eric.snow
2013-07-01 23:58:04
vstinner
set
nosy: + vstinner
2013-07-01 18:17:55
Arfrever
set
nosy: + Arfrever
2013-07-01 16:33:50
brett.cannon
create