This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Oren Milman
Recipients Oren Milman
Date 2017-09-09.17:36:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
at least on my Windows, the following code:

import sys
sys.modules = []

- when run interactively, causes weird behavior, e.g. exit() doesn't exit the
  interpreter, and print() doesn't print.
  then, pressing Ctrl+C causes 'Assertion failed: !PyErr_Occurred(), file ..\Objects\call.c, line 803'

- when run as a script, causes PyImport_Cleanup() to raise a negative ref count
  Fatal Python error.

  (this is because PyImport_Cleanup() (in Python/import.c) assumes that
  PyImport_GetModuleDict() returned a dict.)

IIUC, this bug was introduced in
(which resolved #28411).
Date User Action Args
2017-09-09 17:36:26Oren Milmansetrecipients: + Oren Milman
2017-09-09 17:36:26Oren Milmansetmessageid: <>
2017-09-09 17:36:25Oren Milmanlinkissue31404 messages
2017-09-09 17:36:25Oren Milmancreate