Author xtreak
Recipients vstinner, xtreak
Date 2018-10-01.10:36:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538390197.62.0.545547206417.issue34812@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks Victor for the details. 

> In the C code, sys.flags.isolated clearly documented as linked to the -I option:

With respect to documentation I was talking about '-I' not being documented in the table at https://docs.python.org/3.7/library/sys.html#sys.flags though it's present in the C code and in sys.flags.isolated.

> -I is different from -s -E: it also avoids to add the script directory or an empty string to sys.path.

'-I' also implies '-s -E' and hence adding isolated to args_from_interpreter_flags will also return ['-s', '-E', '-I'] as output and hence I suggested modifying the comparison logic.

# Since '-I' implies '-s' and '-E' those flags are also set returning '-s -E -I'

./python.exe --help | rg '\-I'
-I     : isolate Python from the user's environment (implies -E and -s)

./python.exe -I -c 'import sys; print(sys.flags)'
sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=1, no_site=0, ignore_environment=1, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=1, dev_mode=False, utf8_mode=0)

# patching args_from_interpreter_flags to support '-I' would return below

./python.exe -I -c 'import subprocess; print(subprocess._args_from_interpreter_flags())'
['-s', '-E', '-I']


Thanks
History
Date User Action Args
2018-10-01 10:36:37xtreaksetrecipients: + xtreak, vstinner
2018-10-01 10:36:37xtreaksetmessageid: <1538390197.62.0.545547206417.issue34812@psf.upfronthosting.co.za>
2018-10-01 10:36:37xtreaklinkissue34812 messages
2018-10-01 10:36:37xtreakcreate