cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
6.31k stars 311 forks source link

python: zoneinfo is pretty much broken #1972

Open mayli opened 8 months ago

mayli commented 8 months ago

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'
hoodmane commented 8 months ago

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 commented 8 months ago

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