Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Python have a "PYTHONBUFFERED" Environment Variable?

Tags:

python

I see many people setting ENV PYTHONBUFFERED=1 in their Dockerfile. Just Google it.

I know that PYTHONUNBUFFERED exists (emphasis on the "UN").

So my basic question is, does PYTHONBUFFERED exist, do a lot of people just misspell it, or is it a concept specific to Docker?

Example seen in a Dockerfile:

FROM --platform=linux/amd64 python:3.10-buster
ENV PYTHONBUFFERED=1
...
like image 374
Jarad Avatar asked Mar 13 '26 14:03

Jarad


1 Answers

While in many cases it's impossible to prove a negative, this isn't one of them.

Searching the CPython source code for PYTHONBUFFERED has no matches. This is, thus, human error.

like image 58
Charles Duffy Avatar answered Mar 15 '26 08:03

Charles Duffy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!