-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for PYTHONUNBUFFERED
is not correct
#128392
Comments
It seems that there is a discrepancy between the code and the documentation for several other environmental variables too. We should investigate when it was introduced and whether it was intentional. And document the code change if it was intentional. In any case the proposed documentation change does not look correct to me. |
I will look into that.
Do you suggest that |
"If this is set" means that the variable is set to any value, including empty string and "0". |
I see. The reason behind this wording is actually following other env var descriptions. For instance PYTHONNOUSERSITE which is extracted with the same |
Documentation
Follow up on: #128377
According to docs,
PYTHONUNBUFFERED
is true if set as a non-empty string. Setting it to"0"
(which is non-empty string) has effect of disabling it though.Related C code:
cpython/Python/initconfig.c
Lines 1786 to 1790 in d903b17
cpython/Python/preconfig.c
Lines 563 to 578 in d903b17
cpython/Python/preconfig.c
Lines 545 to 560 in d903b17
We should probably rephrase it from:
If this is set to a non-empty string...
to:
If this is set...
Linked PRs
PYTHONUNBUFFERED
docs #128393The text was updated successfully, but these errors were encountered: