Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3511c1

Browse files
committed
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.
1 parent 27a4ac5 commit c3511c1

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Doc/library/sys.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,8 @@ always available.
732732

733733
This is a dictionary that maps module names to modules which have already been
734734
loaded. This can be manipulated to force reloading of modules and other tricks.
735+
However, replacing the dictionary will not necessarily work as expected and
736+
deleting essential items from the dictionary may cause Python to fail.
735737

736738

737739
.. data:: path

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ Tests
5959
Documentation
6060
-------------
6161

62+
- Issue #17953: Mention that you shouldn't replace sys.modules and deleting key
63+
items will cause Python to not be happy.
64+
6265
- Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs.
6366

6467
- Issue #14097: improve the "introduction" page of the tutorial.

0 commit comments

Comments
 (0)