Nick Coghlan added the comment:

@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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29857>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to