From fe20fa4ac067d3d25a3219b8c1f6ce0ba3ff0d6f Mon Sep 17 00:00:00 2001 From: andrei kulakov Date: Sun, 24 Oct 2021 12:41:39 -0400 Subject: [PATCH 1/4] Enhanced / clarified the docs for os.environ and os.environb --- Doc/library/os.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 3bfefc6bcd57dc6..356758acea7c753 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -170,9 +170,9 @@ process and user. .. data:: environ - A :term:`mapping` object representing the string environment. For example, - ``environ['HOME']`` is the pathname of your home directory (on some platforms), - and is equivalent to ``getenv("HOME")`` in C. + A :term:`mapping` object of key and value strings that represent the process + environment. For example, ``environ['HOME']`` is the pathname of your home + directory (on some platforms), and is equivalent to ``getenv("HOME")`` in C. This mapping is captured the first time the :mod:`os` module is imported, typically during Python startup as part of processing :file:`site.py`. Changes @@ -209,10 +209,10 @@ process and user. .. data:: environb - Bytes version of :data:`environ`: a :term:`mapping` object representing the - environment as byte strings. :data:`environ` and :data:`environb` are - synchronized (modify :data:`environb` updates :data:`environ`, and vice - versa). + Bytes version of :data:`environ`: a :term:`mapping` object of key and value + byte strings representing the process environment. :data:`environ` and + :data:`environb` are synchronized (modify :data:`environb` updates + :data:`environ`, and vice versa). :data:`environb` is only available if :data:`supports_bytes_environ` is ``True``. From b6740726335157abd6ce76ac1d5617fb837dab1a Mon Sep 17 00:00:00 2001 From: andrei kulakov Date: Thu, 28 Oct 2021 16:21:31 -0400 Subject: [PATCH 2/4] update wording --- Doc/library/os.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 356758acea7c753..f6189e1c659bc88 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -170,9 +170,10 @@ process and user. .. data:: environ - A :term:`mapping` object of key and value strings that represent the process - environment. For example, ``environ['HOME']`` is the pathname of your home - directory (on some platforms), and is equivalent to ``getenv("HOME")`` in C. + A :term:`mapping` object where keys and values are strings that represent + the process environment. For example, ``environ['HOME']`` is the pathname + of your home directory (on some platforms), and is equivalent to + ``getenv("HOME")`` in C. This mapping is captured the first time the :mod:`os` module is imported, typically during Python startup as part of processing :file:`site.py`. Changes @@ -209,10 +210,10 @@ process and user. .. data:: environb - Bytes version of :data:`environ`: a :term:`mapping` object of key and value - byte strings representing the process environment. :data:`environ` and - :data:`environb` are synchronized (modify :data:`environb` updates - :data:`environ`, and vice versa). + Bytes version of :data:`environ`: a :term:`mapping` object where keys and + values are :class:`bytes` objects representing the process environment. + :data:`environ` and :data:`environb` are synchronized (modify + :data:`environb` updates :data:`environ`, and vice versa). :data:`environb` is only available if :data:`supports_bytes_environ` is ``True``. From 2947b2a986c699ad7ead8e5608a27c354cd9c460 Mon Sep 17 00:00:00 2001 From: andrei kulakov Date: Thu, 28 Oct 2021 16:22:57 -0400 Subject: [PATCH 3/4] add "both" --- Doc/library/os.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index f6189e1c659bc88..d80a3529177d4d9 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -210,8 +210,8 @@ process and user. .. data:: environb - Bytes version of :data:`environ`: a :term:`mapping` object where keys and - values are :class:`bytes` objects representing the process environment. + Bytes version of :data:`environ`: a :term:`mapping` object where both keys + and values are :class:`bytes` objects representing the process environment. :data:`environ` and :data:`environb` are synchronized (modify :data:`environb` updates :data:`environ`, and vice versa). From 56d76830095a7554ff6a2ed873a5eaefeb6e226d Mon Sep 17 00:00:00 2001 From: andrei kulakov Date: Thu, 28 Oct 2021 17:06:10 -0400 Subject: [PATCH 4/4] Update Doc/library/os.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ɓukasz Langa --- Doc/library/os.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index d80a3529177d4d9..8092397be650f9d 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -212,7 +212,7 @@ process and user. Bytes version of :data:`environ`: a :term:`mapping` object where both keys and values are :class:`bytes` objects representing the process environment. - :data:`environ` and :data:`environb` are synchronized (modify + :data:`environ` and :data:`environb` are synchronized (modifying :data:`environb` updates :data:`environ`, and vice versa). :data:`environb` is only available if :data:`supports_bytes_environ` is