mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
bpo-45600: Enhanced / clarified the docs for os.environ and os.environb (GH-29204)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
3877fc02f7
commit
b17cfd150f
1 changed files with 8 additions and 7 deletions
|
|
@ -170,9 +170,10 @@ process and user.
|
||||||
|
|
||||||
.. data:: environ
|
.. data:: environ
|
||||||
|
|
||||||
A :term:`mapping` object representing the string environment. For example,
|
A :term:`mapping` object where keys and values are strings that represent
|
||||||
``environ['HOME']`` is the pathname of your home directory (on some platforms),
|
the process environment. For example, ``environ['HOME']`` is the pathname
|
||||||
and is equivalent to ``getenv("HOME")`` in C.
|
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,
|
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
|
typically during Python startup as part of processing :file:`site.py`. Changes
|
||||||
|
|
@ -209,10 +210,10 @@ process and user.
|
||||||
|
|
||||||
.. data:: environb
|
.. data:: environb
|
||||||
|
|
||||||
Bytes version of :data:`environ`: a :term:`mapping` object representing the
|
Bytes version of :data:`environ`: a :term:`mapping` object where both keys
|
||||||
environment as byte strings. :data:`environ` and :data:`environb` are
|
and values are :class:`bytes` objects representing the process environment.
|
||||||
synchronized (modify :data:`environb` updates :data:`environ`, and vice
|
:data:`environ` and :data:`environb` are synchronized (modifying
|
||||||
versa).
|
:data:`environb` updates :data:`environ`, and vice versa).
|
||||||
|
|
||||||
:data:`environb` is only available if :data:`supports_bytes_environ` is
|
:data:`environb` is only available if :data:`supports_bytes_environ` is
|
||||||
``True``.
|
``True``.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue