This commit is contained in:
Savannah Ostrowski 2025-12-08 04:14:26 +00:00 committed by GitHub
commit 4042b28479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -644,6 +644,12 @@ variables and terminal capabilities. However, if ``color=False``, colored
output is always disabled, even if environment variables like ``FORCE_COLOR``
are set.
.. note::
Error messages will include color codes when redirecting stderr to a
file. To avoid this, set the |NO_COLOR|_ or :envvar:`PYTHON_COLORS`
environment variable (e.g., ``NO_COLOR=1 python script.py 2> errors.txt``).
.. versionadded:: 3.14