[issue3441] Regression in "module as a script" command-line option

Nick Coghlan report at bugs.python.org
Sat Jul 26 09:10:37 CEST 2008


Nick Coghlan <ncoghlan at gmail.com> added the comment:

If I recall correctly (it's been a while), the breakages were tied in
with relative imports - probably something like explicit relative
imports not working at all, and implicit relative imports appearing to
work, but resulting in incorrect module names and sys.modules entries
(similar to running a file from inside a package directly).

Doing "python -m package.__init__" instead of "python -m package" is
actually better behaved (although still a little odd - the
__init__ module code gets run once on the actual package import, and
then again as __main__).

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


More information about the Python-bugs-list mailing list