From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:01:05 +0000 (-0700) Subject: gh-83940: os docs: Improve wording for getenv/getenvb (GH-98113) X-Git-Tag: v3.11.0~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f58d8ce78913774ebb33f9f1f29f4acc2c004f2;p=thirdparty%2FPython%2Fcpython.git gh-83940: os docs: Improve wording for getenv/getenvb (GH-98113) (cherry picked from commit 187e853690908ca2af19a0701ca7529b43d05df9) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> --- diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 27b74f9f0cd7..c667592dc202 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -299,8 +299,8 @@ process and user. .. function:: getenv(key, default=None) - Return the value of the environment variable *key* if it exists, or - *default* if it doesn't. *key*, *default* and the result are str. Note that + Return the value of the environment variable *key* as a string if it exists, or + *default* if it doesn't. *key* is a string. Note that since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` is similarly also captured on import, and the function may not reflect future environment changes. @@ -314,8 +314,8 @@ process and user. .. function:: getenvb(key, default=None) - Return the value of the environment variable *key* if it exists, or - *default* if it doesn't. *key*, *default* and the result are bytes. Note that + Return the value of the environment variable *key* as bytes if it exists, or + *default* if it doesn't. *key* must be bytes. Note that since :func:`getenvb` uses :data:`os.environb`, the mapping of :func:`getenvb` is similarly also captured on import, and the function may not reflect future environment changes.