You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The way the pure Python and C extensions are loaded side-by side is somewhat fragile, and actually had to be changed in upstream because the C extension lives at _zoneinfo instead of zoneinfo._czoneinfo (which changes how sys.modules gets populated, evidently).
The most common symptom is that in the test for bad keys, the assertRaises context manager fails to catch ZoneInfoNotFound in one or the other of the modules, because py_zoneinfo.ZoneInfoNotFound gets raised from c_zoneinfo or vice versa, for some reason.
I recall there was also a situation where trying to include typing_example in the tests to run would cause this, and I'm also seeing another manifestation at work.
This probably comes down to something like:
The fact that we're doing a partial import (since to import zoneinfo._czoneinfo you need to import zoneinfo first, which then tries to import zoneinfo._czoneinfo).
The fact that we're not blocking anything when importing zoneinfo multiple times — one or more of the modules might be getting _tzpath from the other one?
I'll try to come up with a minimal reproducer of at least one of the issues so we can try and work through why it's so flaky.
The text was updated successfully, but these errors were encountered:
The way the pure Python and C extensions are loaded side-by side is somewhat fragile, and actually had to be changed in upstream because the C extension lives at
_zoneinfo
instead ofzoneinfo._czoneinfo
(which changes howsys.modules
gets populated, evidently).The most common symptom is that in the test for bad keys, the
assertRaises
context manager fails to catchZoneInfoNotFound
in one or the other of the modules, becausepy_zoneinfo.ZoneInfoNotFound
gets raised fromc_zoneinfo
or vice versa, for some reason.I recall there was also a situation where trying to include
typing_example
in the tests to run would cause this, and I'm also seeing another manifestation at work.This probably comes down to something like:
zoneinfo._czoneinfo
you need to importzoneinfo
first, which then tries to importzoneinfo._czoneinfo
).zoneinfo
multiple times — one or more of the modules might be getting_tzpath
from the other one?I'll try to come up with a minimal reproducer of at least one of the issues so we can try and work through why it's so flaky.
The text was updated successfully, but these errors were encountered: