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 <1602328488.44.0.393274794411.issue41994@roundup.psfhosted.org>
In-reply-to
Content
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().
History
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: <1602328488.44.0.393274794411.issue41994@roundup.psfhosted.org>
2020-10-10 11:14:48serhiy.storchakalinkissue41994 messages
2020-10-10 11:14:48serhiy.storchakacreate