workerd icon indicating copy to clipboard operation
workerd copied to clipboard

python: zoneinfo is pretty much broken

Open mayli opened this issue 1 year ago • 2 comments

https://docs.python.org/3/library/zoneinfo.html

zoneinfo.available_timezones()[¶](https://docs.python.org/3/library/zoneinfo.html#zoneinfo.available_timezones) return an empty and any access results something like

  File "/lib/python312.zip/zoneinfo/_common.py", line 24, in load_tzdata
    raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key UTC'

mayli avatar Apr 05 '24 07:04 mayli

Yes, system timezone data is not available and the tzdata package is not around.

By default, zoneinfo uses the system’s time zone data if available; if no system time zone data is available, the library will fall back to using the first-party tzdata package available on PyPI.

We should probably vendor tzdata so that it will work as expected @dom96 @garrettgu10.

hoodmane avatar Apr 05 '24 08:04 hoodmane

Upstream bug: https://github.com/pyodide/pyodide/issues/4668

hoodmane avatar Apr 05 '24 08:04 hoodmane