Skip to content

Commit

Permalink
pythongh-101754: Document that Windows converts keys in os.environ
Browse files Browse the repository at this point in the history
…to uppercase (pythonGH-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
1 parent 47cc6fa commit 755862e
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 @@ -188,6 +188,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 755862e

Please sign in to comment.