diff --git a/Doc/library/os.rst b/Doc/library/os.rst index af02a373f33..2b3821bb3ee 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -217,7 +217,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. + *default* if it doesn't. Only *key* needs to be a string as it is used to + lookup the value in os.environ. On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding` and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you diff --git a/Misc/NEWS.d/next/Documentation/2020-02-26-15-21-17.bpo-39759.mMDBAl.rst b/Misc/NEWS.d/next/Documentation/2020-02-26-15-21-17.bpo-39759.mMDBAl.rst new file mode 100644 index 00000000000..c47e836a193 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-02-26-15-21-17.bpo-39759.mMDBAl.rst @@ -0,0 +1 @@ +Fixed os.getenv documentation.