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 Nils Kattenbeck
Recipients Nils Kattenbeck, bethard, jwilk, ncoghlan, paul.j3, peter.otten, samuelmarks, tebeka, zertrin
Date 2021-08-08.22:41:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628462460.6.0.00495562011724.issue22240@roundup.psfhosted.org>
In-reply-to
Content
I implemented the logic and adjusted the existing tests to have a fixed program name. I also fixed the build error by changing how zip files are detected. Based on you comment Nick you however even had a different idea. Currently I check if __spec__.__loader__ is a zip loader but if I understood correct you suggest the check if __spec__.__location__ is a proper subdir of sys.argv[0]?

https://github.com/septatrix/cpython/compare/main...septatrix:enhance/argparse-prog-name.

When I have some more time I will check whether mocking works and otherwise checkout test.support.script_helper or making the function accept spec/argv0
History
Date User Action Args
2021-08-08 22:41:00Nils Kattenbecksetrecipients: + Nils Kattenbeck, tebeka, ncoghlan, peter.otten, bethard, jwilk, paul.j3, zertrin, samuelmarks
2021-08-08 22:41:00Nils Kattenbecksetmessageid: <1628462460.6.0.00495562011724.issue22240@roundup.psfhosted.org>
2021-08-08 22:41:00Nils Kattenbecklinkissue22240 messages
2021-08-08 22:41:00Nils Kattenbeckcreate