Ronald Oussoren added the comment:
Given a python script in a file named foo.py in the current directory:
* python -m foo
Should, and does, work.
* python -m foo.py
Raises an error, because the command tries to run the submodule "py" of
module "foo" as the __main__ module. For
Colin Dick added the comment:
No, the first example is expected,
BUT the middle two work
HENCE the last should NOT have a problem either...
No?
Because the middle two work,
so should the last complete without any errors.
There were no code changes,
Therefore the problem is with python
On Wed,
Ronald Oussoren added the comment:
This is not a bug:
* "python -m NAME" runs module (or package) NAME as a script, NAME should
therefore be a module name and not a filename (and hence not have a .py suffix)
* "python NAME" runs a script in file NAME and should therefore by a complete
file
SilentGhost added the comment:
Colin, sorry, are you reporting an issue? Because I have trouble understanding
what is. The examples you've posted seem to work as expected, no?
--
nosy: +SilentGhost
___
Python tracker
New submission from Colin Dick :
-m switch revisited - see issue 27487
Win 10 64bit
python 3.6.3 & 3.7.3
initially running code using py 3.6.3 with this command
python -m vixsd.py
produced
C:\Python36\python.exe: Error while finding module specification for 'vixsd.py'
(AttributeError: module