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, serhiy.storchaka
Date 2020-10-10.11:14:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
There is a reference leak in import_add_module(). PyDict_GetItemWithError() returns a borrowed reference, but PyObject_GetItem() return a non-borrowed reference. If sys.modules is not a dict, there is a reference leak. import_add_module() and several other function which return a borrowed reference should be made returning a non-borrowed reference, because there are no guaranties that general mapping keeps reference to value.

It is still not guarantee correctness of PyImport_AddModuleObject().
Date User Action Args
2020-10-10 11:14:48serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, ncoghlan, eric.snow
2020-10-10 11:14:48serhiy.storchakasetmessageid: <>
2020-10-10 11:14:48serhiy.storchakalinkissue41994 messages
2020-10-10 11:14:48serhiy.storchakacreate