Skip to content

Commit

Permalink
gh-101754: Document that Windows converts keys in os.environ to upp…
Browse files Browse the repository at this point in the history
…ercase (GH-101840)

(cherry picked from commit 4e7c0cb)

Co-authored-by: Owain Davies <[email protected]>
  • Loading branch information
miss-islington and OTheDev authored Mar 3, 2023
1 parent 3b1201d commit 32a738e
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 32a738e

Please sign in to comment.