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 serhiy.storchaka
Recipients brett.cannon, eric.snow, ncoghlan, pitrou, serhiy.storchaka
Date 2018-04-22.10:38:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Since dict is ordered, modules in sys.modules are ordered for the time of importing. Currently they are cleaned in PyImport_Cleanup() in the direct order -- from imported first to imported later. I wonder if cleaning them in the reversed order can solve some problems with the interpreter shutdown.

For example reverting the order fixes issue33328 and may help in other cases.

If revert the order, should only iterating weaklist be reverted (with setting all module globals to None), or iterating sys.modules (with setting sys.module values to None) too?
Date User Action Args
2018-04-22 10:38:18serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, ncoghlan, pitrou, eric.snow
2018-04-22 10:38:18serhiy.storchakasetmessageid: <>
2018-04-22 10:38:18serhiy.storchakalinkissue33331 messages
2018-04-22 10:38:17serhiy.storchakacreate