GH-155009: Preserve argparse prog for programmatic module-as-main execution - #155199
Conversation
|
Thanks @savannahostrowski for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
GH-155200 is a backport of this pull request to the 3.15 branch. |
|
GH-155201 is a backport of this pull request to the 3.14 branch. |
|
|
I opted to compare
sys.argv[0]with__main__.__spec__.originbecause looking for an adjacent-m, module pair insys.orig_argvcan mistake application arguments for an interpreter option and miss valid forms such as-mmodule.argparsereportspython -mfor programmatic module-as-main execution #155009