Message354999
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. |
|
Date |
User |
Action |
Args |
2019-10-20 13:09:00 | ncoghlan | set | recipients:
+ ncoghlan, vstinner, r.david.murray, yselivanov, Michel Desmoulin, xtreak |
2019-10-20 13:09:00 | ncoghlan | set | messageid: <1571576940.67.0.261573597148.issue20443@roundup.psfhosted.org> |
2019-10-20 13:09:00 | ncoghlan | link | issue20443 messages |
2019-10-20 13:09:00 | ncoghlan | create | |
|