This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Devin Jeanpierre
Recipients Devin Jeanpierre
Date 2013-03-19.00:14:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1363652047.27.0.660639170602.issue17473@psf.upfronthosting.co.za>
In-reply-to
Content
Many executables in python are meant to be run on python scripts, but can't run python scripts that are part of a package. For example, one can do `python -m pdb foo.py`, but not `python -m pdb package.foo`. This makes it more difficult to interact with executable scripts within a package. In particular, the following will NOT work in general: `python -m pdb package/foo.py`

It would be easier if these modules gained their own `-m` argument to specify import paths instead of files. For example, the third party coverage module does this, and can be run using the command `python -m coverage run -m package.foo`.

What follows is a small list of scripts present as modules in the Python stdlib that involve manipulating other scripts, and so could benefit from a -m option.

pdb
profile
doctest
trace
modulefinder
tabnanny
pyclbr
dis

In the case of pydoc, unittest (unittest discover, etc.) -- these are special cases, as they interpret input as either a path OR a module via guessing. There may not be any benefit to adding a -m option.
History
Date User Action Args
2013-03-19 00:14:07Devin Jeanpierresetrecipients: + Devin Jeanpierre
2013-03-19 00:14:07Devin Jeanpierresetmessageid: <1363652047.27.0.660639170602.issue17473@psf.upfronthosting.co.za>
2013-03-19 00:14:07Devin Jeanpierrelinkissue17473 messages
2013-03-19 00:14:06Devin Jeanpierrecreate