Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-101754: Document that Windows converts keys in os.environ to upp…
…ercase (GH-101840)

(cherry picked from commit 4e7c0cb)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
  • Loading branch information
OTheDev authored and miss-islington committed Mar 3, 2023
commit 6082c4fc52514d27ac0271077247a54f71aa1fb9
5 changes: 5 additions & 0 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down