[Python-checkins] gh-101754: Document that Windows converts keys in `os.environ` to uppercase (GH-101840)
miss-islington
webhook-mailer at python.org
Fri Mar 3 06:00:13 EST 2023
https://github.com/python/cpython/commit/32a738e5b3b54b667bfbe3f8d7cb1f51230e95a0
commit: 32a738e5b3b54b667bfbe3f8d7cb1f51230e95a0
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2023-03-03T03:00:06-08:00
summary:
gh-101754: Document that Windows converts keys in `os.environ` to uppercase (GH-101840)
(cherry picked from commit 4e7c0cbf59595714848cf9827f6e5b40c3985924)
Co-authored-by: Owain Davies <116417456+OTheDev at users.noreply.github.com>
files:
M Doc/library/os.rst
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 759064a6e52e..e3e20510f809 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -201,6 +201,11 @@ process and user.
``'surrogateescape'`` error handler. Use :data:`environb` if you would like
to use a different encoding.
+ On Windows, the keys are converted to uppercase. This also applies when
+ getting, setting, or deleting an item. For example,
+ ``environ['monty'] = 'python'`` maps the key ``'MONTY'`` to the value
+ ``'python'``.
+
.. note::
Calling :func:`putenv` directly does not change :data:`os.environ`, so it's better
More information about the Python-checkins
mailing list