Fresh venv with nothing but psycopg and tzdata. Psycopg raised the same error and here's what a simple ZoneInfo lookup says... It just apparently thinks the zone setting should resolve to a file path in the tzdata directory which makes sense. I just recently upgraded to Python 3.9.12 but as we're just starting to dig into Psycopg3, I may very well have not ever queried a TimestampTZ value till this morning :-) this is a straight venv which I believe doesn't load site packages by default. Anyhow as we get ready for Pg14, it looks like the localtime will have to be changed on the servers regardless. >>> import zoneinfo >>> zoneinfo.ZoneInfo('localtime') Traceback (most recent call last): File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zoneinfo/_common.py", line 12, in load_tzdata return importlib.resources.open_binary(package_name, resource_name) File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/resources.py", line 91, in open_binary return reader.open_resource(resource) File "<frozen importlib._bootstrap_external>", line 1055, in open_resource FileNotFoundError: [Errno 2] No such file or directory: '/private/tmp/.venv/lib/python3.9/site-packages/tzdata/zoneinfo/localtime' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/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 localtime' >>>
|