[New-bugs-announce] [issue3619] A more informative message for ImportError

Kent Tenney report at bugs.python.org
Wed Aug 20 16:00:34 CEST 2008


New submission from Kent Tenney <ktenney at gmail.com>:

from foo import bar
ImportError: cannot import name bar

The error may be due to the wrong 'foo' being found, some investigation
is required.

If the the ImportError message included the filename for 'foo', the
problem would be obvious.
ImportError cannot import name bar from  /usr/lib/<snip>/foo.pyc

A c.l.p. thread on this is at
http://groups.google.com/group/comp.lang.python/browse_thread/thread/88474a32877026fc/

a patch from Wojtek Walczak is here and attached
http://www.stud.umk.pl/~wojtekwa/patches/from-import-py2.5.1.patch

a thread about it on python-dev is here
http://mail.python.org/pipermail/python-dev/2008-August/081889.html

including a comment on the patch
http://mail.python.org/pipermail/python-dev/2008-August/081897.html

----------
components: None
files: from-import-py2.5.1.patch
keywords: patch
messages: 71542
nosy: ktenney
severity: normal
status: open
title: A more informative message for ImportError
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file11173/from-import-py2.5.1.patch

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


More information about the New-bugs-announce mailing list