New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C implementation of ZoneInfo cannot be subclassed #85197
Comments
In the C implementation of zoneinfo.ZoneInfo, __init_subclass__ is not declared as a classmethod, which prevents it from being subclassed. This was not noticed because the tests for ZoneInfo subclasses in C are actually testing zoneinfo.ZoneInfo, not a subclass, due to a mistake in the inheritance tree: cpython/Lib/test/test_zoneinfo/test_zoneinfo.py Lines 465 to 487 in 8f192d1
Originally reported on the backport by Sébastien Eustace: pganssle/zoneinfo#82 The fix in the backport is here: pganssle/zoneinfo#83 |
Marking as release blocker to put it on the checklist. Feel free to demote it if you decide it should be deferred to 3.9.1. |
This change introduced a reference leak. 3.9 and master branch are affected. $ make && ./python -m test -R 3:3 test_zoneinfo
(...)
test_zoneinfo leaked [84, 84, 84] references, sum=252
test_zoneinfo leaked [41, 41, 41] memory blocks, sum=123
(...) ZoneInfoSubclassTest and CZoneInfoSubclassTest test cases leak. Example of test method which leaks: test.test_zoneinfo.test_zoneinfo.CZoneInfoSubclassTest.test_folds_and_gaps |
There are two refleaks here. One is a reference leaking to the weak cache in I'll send a PR to fix it shortly. |
Reported as bpo-41568 and fixed there. |
Paul: What is the status of this issue? Is it already fixed? It is the release blocker priority. |
This is fixed in the 3.9 and master branches, it needs to be cherry-picked into the 3.9.0 release (at Łukasz's discretion, of course). Łukasz: If you cherry-pick #65164/GH-21876 into the 3.9.0 release, please also cherry-pick #66106/GH-21912, since that fixes the refleak. (PRs are listed as "master"/"backport" since I don't know your workflow). |
I will be cutting RC2 from the head of 3.9. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: