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 ncoghlan
Recipients Dima.Tisnek, Mariatta, davide.rizzo, docs@python, ezio.melotti, ncoghlan, nedbat, r.david.murray
Date 2016-10-05.15:18:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475680711.29.0.236377599263.issue24632@psf.upfronthosting.co.za>
In-reply-to
Content
Yeah, I never found a good place to document this, hence the relatively sparse references in the "using" docs.

The most complete official docs for these features are actually in runpy:

* https://docs.python.org/3/library/runpy.html#runpy.run_module
* https://docs.python.org/3/library/runpy.html#runpy.run_path

run_module is a thin wrapper around the same core code that actually implements the -m switch

run_path is a Python level reimplementation of the __main__ execution logic

There's also http://www.curiousefficiency.org/posts/2011/03/what-is-python-script.html on my blog and the explanation of the options that need to be supported in PEP 432: https://www.python.org/dev/peps/pep-0432/#preparing-the-main-module

A lot of the confusion stems from the fact that directory & zipfile execution was added without a PEP back in 2.6 (it was just a normal tracker issue) and we forgot to add it to the What's New document. We hoped the inclusion of the zipapp module in Python 3.5 via PEP 441 might help resolve that lack of awareness, but it doesn't seem to have had much impact.
History
Date User Action Args
2016-10-05 15:18:31ncoghlansetrecipients: + ncoghlan, nedbat, ezio.melotti, r.david.murray, docs@python, davide.rizzo, Dima.Tisnek, Mariatta
2016-10-05 15:18:31ncoghlansetmessageid: <1475680711.29.0.236377599263.issue24632@psf.upfronthosting.co.za>
2016-10-05 15:18:31ncoghlanlinkissue24632 messages
2016-10-05 15:18:31ncoghlancreate