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 barry, jwilk, ncoghlan, steven.daprano, vstinner
Date 2017-03-21.14:54:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490108096.66.0.0538094082413.issue29857@psf.upfronthosting.co.za>
In-reply-to
Content
@Steven This is an implementation detail in the same sense that sys._getframe() is: it's not something that's actually going to make sense in all contexts. For example, if Py_Main() is never called (for CPython), it would still be None, and other implementations may not define it at all. And even when it's set for CPython, the exact details of what it contains are going to be at least somewhat platform dependent.

@Barry On Windows we define `mainw` rather than `main`, so it's the UTF-16-LE encoded text that is the "raw" form. That means the "raw" here refers to "before the Python interpreter CLI processing" - the normalization step to get the command line to wchar_t regardless of platform isn't going to be skipped (since the interpreter runtime itself never even sees the raw bytes in Python 3).

One option would be to use a longer name like `sys._executable_argv`, since in the typical case, `sys.executable` and `sys._executable_argv[0]` will be the same.

@Victor It wouldn't be exactly the same as Py_GetArgcArgv, as I'd propose making a pristine copy *before* Py_Main() mutates anything - we do some in-place editing of entries while figuring out what "sys.argv[0]" should look like at the Python level.
History
Date User Action Args
2017-03-21 14:54:56ncoghlansetrecipients: + ncoghlan, barry, vstinner, jwilk, steven.daprano
2017-03-21 14:54:56ncoghlansetmessageid: <1490108096.66.0.0538094082413.issue29857@psf.upfronthosting.co.za>
2017-03-21 14:54:56ncoghlanlinkissue29857 messages
2017-03-21 14:54:56ncoghlancreate