[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread Nick Coghlan
Nick Coghlan added the comment: There are actually 3 attributes that may be absent when CPython itself isn't managing the C level entry point: sys.argv, sys.warnoptions, and sys._xoptions. I'd be more inclined to make the implementation match the docs though, and have

[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread Pedro
Pedro added the comment: My comment above uses "code that we provide for supporting embedding," not "third party code," as the definition of embedded. -- ___ Python tracker

[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread Pedro
Pedro added the comment: My first inclination would be no. An argv value of [''] means "zero command-line arguments" (not even a filename), which implies the following as far as I know: 1. Python was called as an executable rather than a library, because you can't

[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +ncoghlan ___ Python tracker ___ ___

[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread R. David Murray
R. David Murray added the comment: A better question might be: is there something in the embedding framework that should initialize argv to the empty list? embedding framework here could have two meanings: either the third party code, or the code that we provide for

[issue32573] sys.argv documentation should include caveat for embedded environments

2018-01-16 Thread Pedro
New submission from Pedro : Embedded Python interpreters, such as Boost.Python, do not have sys.argv available. (sys itself works fine.) This causes the interpreter to crash with the following exception when you try to access argv: AttributeError: 'module'