[issue8754] ImportError: quote bad module name in message

Éric Araujo report at bugs.python.org
Thu Nov 18 03:40:46 CET 2010


Éric Araujo <merwok at netwok.org> added the comment:

Thanks for the reply.

Funny thing, grep revealed a small inconsistency in this error message:

Python/pythonrun.c:415:     * XXX     Exception exceptions.ImportError: 'No module named sha'
Python/import.c:1821:                     "No module named %.200s", name);
Python/import.c:2722:                     "No module named %.200s", name);
Lib/test/test_multiprocessing.py:27:# message: "No module named _multiprocessing". _multiprocessing is not compiled
Lib/test/test_concurrent_futures.py:8:# message: "No module named _multiprocessing". _multiprocessing is not compiled
Lib/test/test_pydoc.py:194:badimport_pattern = "problem in %s - ImportError: No module named %s"
Lib/runpy.py:104:        raise ImportError("No module named %s" % mod_name)
Lib/xml/etree/ElementTree.py:1492:                    "No module named expat; use SimpleXMLTreeBuilder instead"
Lib/modulefinder.py:189:        self.msgout(4, "raise ImportError: No module named", qname)
Lib/modulefinder.py:190:        raise ImportError("No module named " + qname)
Lib/modulefinder.py:202:                self.msgout(4, "raise ImportError: No module named", mname)
Lib/modulefinder.py:203:                raise ImportError("No module named " + mname)
Lib/modulefinder.py:219:                    raise ImportError("No module named " + subname)
Lib/importlib/_bootstrap.py:811:                raise ImportError("no module named {}; "
Lib/importlib/_bootstrap.py:820:            raise ImportError("No module named {0}".format(name))
Lib/unittest/test/test_loader.py:242:            self.assertEqual(str(e), "No module named sdasfasfasdf")
Lib/unittest/test/test_loader.py:622:            self.assertEqual(str(e), "No module named sdasfasfasdf")

Fixing the Python modules is easy, but I don’t know how to change PyErr_Format (or how to write C, for that matter :)  Do you make offers like Alexandre, who has proposed to write the C part if someone provides a diff for the Python version?

----------

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


More information about the Python-bugs-list mailing list