diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 7b043f257ca0b57..a7aa0c5fd14f967 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -214,6 +214,11 @@ process and user. cause memory leaks. Refer to the system documentation for :c:func:`!putenv`. + .. warning:: + Setting or unsetting environment variables from one thread while + another thread reads or writes them is not guaranteed to be + thread-safe and can crash the process on some platforms. + You can delete items in this mapping to unset environment variables. :func:`unsetenv` will be called automatically when an item is deleted from :data:`os.environ`, and when one of the :meth:`~dict.pop` or