[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-11-04 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset 1b46131ae423f43d45947bb48844cf82f6fd82b8 by Nick Coghlan in 
branch 'master':
bpo-22257: Mention startup refactoring in What's New (GH-4286)
https://github.com/python/cpython/commit/1b46131ae423f43d45947bb48844cf82f6fd82b8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-11-04 Thread Nick Coghlan

Change by Nick Coghlan :


--
pull_requests: +4249

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-11-04 Thread Nick Coghlan

Nick Coghlan  added the comment:

Cross-linking to the work-in-progress RFE that introduced the error: 
https://bugs.python.org/issue22257

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

We could still use some more comprehensive test cases for the env var handling 
and the way that interacts with the command line settings, but the merged PR 
includes at least a rudimentary check for the four that directly affect 
sys.flags without any tricky side effects (PYTHONDEBUG, PYTHONVERBOSE, 
PYTHONOPTIMIZE, PYTHONDONTWRITEBYTECODE).

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-24 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset d7ac06126db86f76ba92cbca4cb702852a321f78 by Nick Coghlan in 
branch 'master':
bpo-31845: Fix reading flags from environment (GH-4105)
https://github.com/python/cpython/commit/d7ac06126db86f76ba92cbca4cb702852a321f78


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-24 Thread Nick Coghlan

Change by Nick Coghlan :


--
keywords: +patch
pull_requests: +4075
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-24 Thread Nick Coghlan

Change by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

Huh, it appears the tests for these features are relying solely on the command 
line options, and not checking that the environment variables are also setting 
the flags properly. We should be able to account for that omission with a 
single new test in `test_cmd_line` that sets every relevant environment 
variable and checks for the expected `sys.flags` contents.

As far as what's actually going wrong goes, it's this sequence of events in 
Py_Main:

_Py_InitializeCore(_config);
... other code ...
apply_command_line_and_environment();

_Py_InitializeCore is setting the internal flags appropriately based on the 
runtime environment, but then Py_Main is stomping over those environmental 
settings with the settings from the command line.

Historically, these operations happened the other way around, so it was solely 
up to the code reading the environment variables to ensure they played nice 
with each other. Now the command line processing logic needs to be updated to 
also ensure that it only ever increases these values and never reduces them.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-23 Thread Stefan Krah

Change by Stefan Krah :


--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-23 Thread Sviatoslav Abakumov

Sviatoslav Abakumov  added the comment:

It seems 1abcf67[1] is the first bad commit.

[1]https://github.com/python/cpython/commit/1abcf6700b4da6207fe859de40c6c1bada6b4fec

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31845] PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

2017-10-23 Thread Sviatoslav Abakumov

Sviatoslav Abakumov  added the comment:

Looks like PYTHONOPTIMIZE has no effect either:

$ python -V
Python 3.7.0a2
$ env PYTHONOPTIMIZE=1 python -c 'import sys; print(sys.flags.optimize)'
0

--
title: Envvar PYTHONDONTWRITEBYTECODE is not respected -> 
PYTHONDONTWRITEBYTECODE and PYTHONOPTIMIZE have no effect

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com