-
-
Notifications
You must be signed in to change notification settings - Fork 220
Closed
Description
Since Python 3.9, ZoneInfo can be used as tzinfo of datetime and time objects.
However, using ZoneInfo with psycopg 3.1.12 results in the following error:
../.venv/lib/python3.11/site-packages/psycopg/_queries.py:105: in dump
self.params = self._tx.dump_sequence(params, self._want_formats)
psycopg_binary/_psycopg/transform.pyx:353: in psycopg_binary._psycopg.Transformer.dump_sequence
???
psycopg_binary/_psycopg/transform.pyx:400: in psycopg_binary._psycopg.Transformer.dump_sequence
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E TypeError: descriptor 'total_seconds' for 'datetime.timedelta' objects doesn't apply to a 'NoneType' object
This error is thrown when a time(13, 1, 1, tzinfo=ZoneInfo("Europe/Prague")) instance is passed to psycopg, but replacing it with time(13, 1, 1, tzinfo=timezone(timedelta(hours=1))) works fine.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels