[issue41994] Refcount issues in import

2021-09-27 Thread Gregory Szorc
Gregory Szorc added the comment: I didn't want to derail this old issue too much. So I filed issue45307 to track a solution. -- ___ Python tracker ___ ___

[issue41994] Refcount issues in import

2021-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: _PyImport_FindExtensionObject is a private API. It was added in 3.3 because import.c and importdl.c needed to share code. Since 3.5 it was only used in import.c, so there is no longer need to expose it. It was removed in 3.10 because there was an issue wit

[issue41994] Refcount issues in import

2021-09-27 Thread Petr Viktorin
Petr Viktorin added the comment: Please don't use private API. The underscore at the beginning marks the function as private. (This has been the case for a long time; in 3.10 it is finally officially documented: https://docs.python.org/3.10/c-api/stable.html#stable ) It has been removed in a

[issue41994] Refcount issues in import

2021-09-26 Thread Gregory Szorc
Gregory Szorc added the comment: While testing 3.10.0rc2, I noticed that commit 4db8988420e0a122d617df741381b0c385af032c removed _PyImport_FindExtensionObject() from libpython. This breaks both PyOxidizer and py2exe, which rely on this function for a custom implementation of Loader.create_m

[issue41994] Refcount issues in import

2021-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Petr! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41994] Refcount issues in import

2021-01-12 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 4db8988420e0a122d617df741381b0c385af032c by Serhiy Storchaka in branch 'master': bpo-41994: Fix refcount issues in Python/import.c (GH-22632) https://github.com/python/cpython/commit/4db8988420e0a122d617df741381b0c385af032c -- nosy: +pe

[issue41994] Refcount issues in import

2020-10-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +21609 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22632 ___ Python tracker ___

[issue41994] Refcount issues in import

2020-10-10 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : 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 oth