[Python-checkins] cpython (3.3): Issue #17953: document that sys.modules shouldn't be replaced (thanks

brett.cannon python-checkins at python.org
Fri May 24 23:31:47 CEST 2013


http://hg.python.org/cpython/rev/4f8160e45cb7
changeset:   83910:4f8160e45cb7
branch:      3.3
parent:      83907:3c4a5dc29417
user:        Brett Cannon <brett at python.org>
date:        Fri May 24 08:05:07 2013 -0400
summary:
  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.

files:
  Doc/library/sys.rst |  2 ++
  Misc/NEWS           |  3 +++
  2 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -732,6 +732,8 @@
 
    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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -59,6 +59,9 @@
 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.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list