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 Michel Desmoulin, ncoghlan, r.david.murray, vstinner, xtreak, yselivanov
Date 2019-10-20.13:09:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571576940.67.0.261573597148.issue20443@roundup.psfhosted.org>
In-reply-to
Content
I think that's a valid point regarding sys.argv[0] - it's the import system and code introspection that wants(/needs) absolute paths, whereas sys.argv[0] gets used in situations (e.g. usage messages) where we should retain whatever the OS gave us, since that best reflects what the user entered.

That's straightforward to selectively revert, though: remove the "config->run_filename != NULL" clause at https://github.com/python/cpython/blob/24dc2f8c56697f9ee51a4887cf0814b6600c1815/Python/initconfig.c#L2201 and add a comment with the reason for the deliberate omission.


That way the OS-provided argv entry will continue to be passed through to sys.argv[0], while everywhere else will get the absolute path.
History
Date User Action Args
2019-10-20 13:09:00ncoghlansetrecipients: + ncoghlan, vstinner, r.david.murray, yselivanov, Michel Desmoulin, xtreak
2019-10-20 13:09:00ncoghlansetmessageid: <1571576940.67.0.261573597148.issue20443@roundup.psfhosted.org>
2019-10-20 13:09:00ncoghlanlinkissue20443 messages
2019-10-20 13:09:00ncoghlancreate