[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

Martin Panter report at bugs.python.org
Thu Jul 14 22:17:17 EDT 2016


Martin Panter added the comment:

I can try to add the RuntimeWarning soon. Obviously we want the warning when executing a submodule like “package.module”. It also seems reasonable to warn when executing a top-level module that has already been imported. I presume we want these to go into the next 3.5 release. What about 2.7?

I guess we don’t want a warning when executing “package.__main__”, even if the parent package is already imported. So I also need to check if sys.modules[...].__path__ exists.

Another thing that I wonder about: What if the message “Error finding spec for . . .” was changed to “Error getting import information for . . .”? I am only just starting to understand that “finding spec” may mean this (I think the documentation has improved since I last tried to understand it).

----------

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


More information about the Python-bugs-list mailing list