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 ncoghlan
Date 2009-09-01.10:56:36
SpamBayes Score 9.653193e-10
Marked as misclassified No
Message-id <1251802599.29.0.539498266032.issue6816@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, the runpy._run_module_as_main() function allows a launch
script to mimic Python's -m switch fairly well.

This RFE suggests making it possible to mimic other command line
behaviour of the CPython interpreter in a documented fashion:

run_module_as_main - document and make public the existing
_run_module_as_main function (exposes -m style functionality)

run_path_as_main - accept a filesystem path and execute it as per the
command line rules for executing named scripts, zipfiles and directories
(exposes normal script execution functionality)

run_file_as_main - accept a file-like object and execute it as per the
command line rules for executing stdin (exposes '-' style functionality)

run_code_as_main - accept a string or code object and execute it
(exposes -c style functionality)

The runpy module would also be updated to expose these via its command
line to ensure they achieve their stated goal of allowing a launch
script to mimic the native interpreter behaviour. Due to the legacy of
implementing -m style execution by default, the module command line will
expose filesystem path execution through a '-f' switch.
History
Date User Action Args
2009-09-01 10:56:39ncoghlansetrecipients: + ncoghlan
2009-09-01 10:56:39ncoghlansetmessageid: <1251802599.29.0.539498266032.issue6816@psf.upfronthosting.co.za>
2009-09-01 10:56:37ncoghlanlinkissue6816 messages
2009-09-01 10:56:36ncoghlancreate