Mailing List Archive

1 2 3 4 5 6  View All
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Erlend Egeberg Aasland <erlend.aasland@innova.no> added the comment:

I've converted _sre to multi-phase init in this branch: https://github.com/erlend-aasland/cpython/tree/bpo-1635741/sre

I'm waiting for GH-23101 to be merged (or rejected) before I submit the PR. It's a fairly large PR (1 file changed, 259 insertions(+), 173 deletions(-), ex. clinic code). Let me know if you want me to split it up.

Here's an overview over the commits in the branch (clinic included):
97fc9aad3f (HEAD -> bpo-1635741/sre, origin/bpo-1635741/sre) Convert _sre to multi-phase initialisation
1 file changed, 55 insertions(+), 15 deletions(-)
f2cc4bdf45 Convert global state to module state
2 files changed, 212 insertions(+), 345 deletions(-)
0d9b3cb47e Establish global module state and add types to it
1 file changed, 28 insertions(+), 14 deletions(-)
823767cf9a Convert _sre scanner type to heap type
1 file changed, 19 insertions(+), 37 deletions(-)
a018a9ce15 Convert _sre match type to heap type
1 file changed, 31 insertions(+), 43 deletions(-)
7e6e997b59 Convert _sre pattern type to heap type
1 file changed, 35 insertions(+), 44 deletions(-)
06d23e377c Add convenience macro
1 file changed, 12 insertions(+)

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

In PR 23131, I added a comment to _PyInterpreter_Clear() to remind me that trying to destroy a Python type after the last GC collection doesn't work as expected:

// All Python types must be destroyed before the last GC collection. Python
// types create a reference cycle to themselves in their in their
// PyTypeObject.tp_mro member (the tuple contains the type).

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 8021875bbcf7385e651def51bc597472a569042c by Victor Stinner in branch 'master':
bpo-1635741: Add PyModule_AddObjectRef() function (GH-23122)
https://github.com/python/cpython/commit/8021875bbcf7385e651def51bc597472a569042c


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

I added a new PyModule_AddObjectRef() function which does not steal a reference to the value on success. I suggest to use this new function instead of PyModule_AddObject() which is usually misused (creating reference leaks).

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by STINNER Victor <vstinner@python.org>:


----------
pull_requests: +22058
pull_request: https://github.com/python/cpython/pull/23146

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by STINNER Victor <vstinner@python.org>:


----------
pull_requests: +22059
pull_request: https://github.com/python/cpython/pull/23147

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by Erlend Egeberg Aasland <erlend.aasland@innova.no>:


----------
pull_requests: +22060
pull_request: https://github.com/python/cpython/pull/23148

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 988f1ec8d2643a0d00851903abcdae90d57ac0e6 by Victor Stinner in branch 'master':
bpo-1635741: _contextvars uses PyModule_AddType() (GH-23147)
https://github.com/python/cpython/commit/988f1ec8d2643a0d00851903abcdae90d57ac0e6


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 18ce7f1d0a3d65f34f25c5964da588743a1bfe3c by Victor Stinner in branch 'master':
bpo-1635741: _ast uses PyModule_AddObjectRef() (GH-23146)
https://github.com/python/cpython/commit/18ce7f1d0a3d65f34f25c5964da588743a1bfe3c


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by STINNER Victor <vstinner@python.org>:


----------
pull_requests: +22063
pull_request: https://github.com/python/cpython/pull/23151

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by Christian Heimes <lists@cheimes.de>:


----------
nosy: -christian.heimes

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 58ca33b4674f39189b03c9a39fa7b676b43b3d08 by Victor Stinner in branch 'master':
bpo-1635741: Fix ref leak in _PyWarnings_Init() error path (GH-23151)
https://github.com/python/cpython/commit/58ca33b4674f39189b03c9a39fa7b676b43b3d08


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 7184218e186811e75be663be78e57d5302bf8af6 by Mohamed Koubaa in branch 'master':
bpo-1635741: Fix PyInit_pyexpat() error handling (GH-22489)
https://github.com/python/cpython/commit/7184218e186811e75be663be78e57d5302bf8af6


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 789359f47c2a744caa9a405131706099fd7ad6bd by Erlend Egeberg Aasland in branch 'master':
bpo-1635741: _sqlite3 uses PyModule_AddObjectRef() (GH-23148)
https://github.com/python/cpython/commit/789359f47c2a744caa9a405131706099fd7ad6bd


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by Erlend Egeberg Aasland <erlend.aasland@innova.no>:


----------
pull_requests: +22082
pull_request: https://github.com/python/cpython/pull/23170

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +22091
pull_request: https://github.com/python/cpython/pull/23139

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +22092
pull_request: https://github.com/python/cpython/pull/23188

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by STINNER Victor <vstinner@python.org>:


----------
pull_requests: +22131
pull_request: https://github.com/python/cpython/pull/23234

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset 95ce7cd0a64e7f4739af2d1c158ef69b6980f12a by Victor Stinner in branch 'master':
bpo-1635741: Fix typo in PyModule_AddObjectRef() doc (GH-23234)
https://github.com/python/cpython/commit/95ce7cd0a64e7f4739af2d1c158ef69b6980f12a


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by STINNER Victor <vstinner@python.org>:


----------
pull_requests: +22134
pull_request: https://github.com/python/cpython/pull/23236

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:


New changeset ba2958ed40d284228836735cbed4a155190e0998 by Victor Stinner in branch 'master':
bpo-40170: Fix PyType_Ready() refleak on static type (GH-23236)
https://github.com/python/cpython/commit/ba2958ed40d284228836735cbed4a155190e0998


----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

See bpo-27400 for the _datetime module: strptime_module variable is not cleared by Py_Finalize().

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Christian Heimes <lists@cheimes.de> added the comment:

See bpo-42333 for _ssl module. The PR introduces module state and ports the _ssl extension to multiphase initialization.

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
Change by mohamed koubaa <koubaa.m@gmail.com>:


----------
pull_requests: +22195
pull_request: https://github.com/python/cpython/pull/23304

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1635741] Py_Finalize() doesn't clear all Python objects at exit [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

For the signal module, see bpo-41713.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue1635741>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

1 2 3 4 5 6  View All