From c3511c1dd8737a96d97deb95b799436e8e27a2fa Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 24 May 2013 08:05:07 -0400 Subject: [PATCH] Issue #17953: document that sys.modules shouldn't be replaced (thanks to interp->modules) and that deleting essential items from the dict can cause Python to blow up. Thanks to Terry Reedy for coming up with initial wording and Yogesh Chaudhari for coming up with a patch using that wording in parallel to my own patch. --- Doc/library/sys.rst | 2 ++ Misc/NEWS | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index e7e853dd8e..bc1d9fe1d5 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -732,6 +732,8 @@ always available. This is a dictionary that maps module names to modules which have already been loaded. This can be manipulated to force reloading of modules and other tricks. + However, replacing the dictionary will not necessarily work as expected and + deleting essential items from the dictionary may cause Python to fail. .. data:: path diff --git a/Misc/NEWS b/Misc/NEWS index 125b153ee7..54ba363eb3 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -59,6 +59,9 @@ Tests Documentation ------------- +- Issue #17953: Mention that you shouldn't replace sys.modules and deleting key + items will cause Python to not be happy. + - Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs. - Issue #14097: improve the "introduction" page of the tutorial. -- 2.40.0