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.

classification
Title: Enhanced environment variables
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, htrd
Priority: normal Keywords: patch

Created on 2001-10-03 10:20 by htrd, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
env.cvs.diff htrd, 2001-10-03 10:20
Messages (2)
msg37771 - (view) Author: Toby Dickenson (htrd) Date: 2001-10-03 10:20
python supports the -d -O and -v command line switches 
by incrementing the Py_DebugFlag, Py_OptimizeFlag and 
Py_VerboseFlag.

It is also possible to set Py_VerboseFlag etc using 
environment variables. The logic is currently:

if env.var. set and non-empty:
    if flag is zero:
        set flag to 1

However it is not possible to use environment 
variables to set the flags to a value greater than one.

This patch changes to logic to:

if env.var. set and non-empty:
    if env.var. is an integer:
        set flag to that integer
    if flag is zero:
        set flag to 1


Under this patch, anyone currently using 
PYTHONVERBOSE=yes will get the same output as before.

PYTHONVERBNOSE=2 will generate more verbosity than 
before.

The only unusual case that the following three are 
still all equivalent:
PYTHONVERBOSE=yespleas
PYTHONVERBOSE=1
PYTHONVERBOSE=0

msg37772 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-10-12 22:16
Logged In: YES 
user_id=6380

Thanks.  Applied as pythonrun.c rev 2.149.

Note that your patch receives a C-minus for style:

- indented 4 spaces
- no space after comma
- no space between "if" and "("
- no spaces around operators

Normally I would have sent it back for that, but I'm in a
forgiving mood today. :-)
History
Date User Action Args
2022-04-10 16:04:30adminsetgithub: 35272
2001-10-03 10:20:30htrdcreate