]> granicus.if.org Git - python/commitdiff
Issue #17953: document that sys.modules shouldn't be replaced (thanks
authorBrett Cannon <brett@python.org>
Fri, 24 May 2013 12:05:07 +0000 (08:05 -0400)
committerBrett Cannon <brett@python.org>
Fri, 24 May 2013 12:05:07 +0000 (08:05 -0400)
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
Misc/NEWS

index e7e853dd8e8fc4f5b6bec2fce383fabb35d6e617..bc1d9fe1d540842c1803799ec431646beb81f4b7 100644 (file)
@@ -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
index 125b153ee70fe15a6e837c3c707196e85bfec979..54ba363eb392307f170f0e9e5d0474d06a16ff0f 100644 (file)
--- 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.