From: Owain Davies <116417456+OTheDev@users.noreply.github.com> Date: Fri, 3 Mar 2023 10:51:32 +0000 (+0700) Subject: gh-101754: Document that Windows converts keys in `os.environ` to uppercase (GH-101840) X-Git-Tag: v3.12.0a6~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e7c0cbf59595714848cf9827f6e5b40c3985924;p=thirdparty%2FPython%2Fcpython.git gh-101754: Document that Windows converts keys in `os.environ` to uppercase (GH-101840) --- diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 85924d0e4836..23ce98785bed 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