classification
Title: C implementation of ZoneInfo cannot be subclassed
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: p-ganssle Nosy List: p-ganssle
Priority: high Keywords: patch

Created on 2020-06-18 14:26 by p-ganssle, last changed 2020-06-18 14:41 by p-ganssle.

Pull Requests
URL Status Linked Edit
PR 20965 open p-ganssle, 2020-06-18 14:41
Messages (1)
msg371817 - (view) Author: Paul Ganssle (p-ganssle) * (Python committer) Date: 2020-06-18 14:26
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: https://github.com/python/cpython/blob/8f192d12af82c4dc40730bf59814f6a68f68f950/Lib/test/test_zoneinfo/test_zoneinfo.py#L465-L487


Originally reported on the backport by S├ębastien Eustace: https://github.com/pganssle/zoneinfo/issues/82

The fix in the backport is here: https://github.com/pganssle/zoneinfo/pull/83
History
Date User Action Args
2020-06-18 14:41:21p-gansslesetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request20143
2020-06-18 14:26:51p-gansslecreate