bpo-1635741: Enhance _datetime error handling by koubaa · Pull Request #23139 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention the modified module name in the PR title.
I suggest to canghe the PR title to "Enhance _datetime error handling" or "Refactor _datetime error handling", since this change is not directly related to multi-phase init. I'm not sure that we can soon convert this module to the multi-phase init because of the PyCapsule C API.
@koubaa Can you provide a TL;DR of why this change is useful or necessary?
@koubaa Can you provide a TL;DR of why this change is useful or necessary?
https://bugs.python.org/issue1635741 describes the overall goal: better embed Python in application. One side of the issue is to ensure that an extension module releases all its resources at Python exit.
asvetlov
changed the title
bpo-1536741: refactoring before multi-phase init
bpo-1536741: refactoring datetime before multi-phase init
koubaa
changed the title
bpo-1536741: refactoring datetime before multi-phase init
bpo-1635741: Enhance _datetime error handling
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for sharing this, I easily forget them.
Oh, me tee! I got exactly the same issue than you a few days ago :-D
Thanks, I merged your PR.
I checked manually for refleak using the following test run with "./python -m test (...) -R 3:3":
def test_leak(self):
support.run_in_subinterp("import _datetime")
I didn't notice any refleak.
Hum, I'm not sure that my manual test is relevant, since _datetime doesn't use multiphase init yet. But it leaks, I don't expect issues with Refleaks buildbots.
kylotan
mannequin
mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters