[New-bugs-announce] [issue45335] Default TIMESTAMP converter in sqlite3 ignores time zone

Ian Fisher report at bugs.python.org
Thu Sep 30 15:37:28 EDT 2021


New submission from Ian Fisher <ian at iafisher.com>:

The SQLite converter that the sqlite3 library automatically registers for TIMESTAMP columns (https://github.com/python/cpython/blob/main/Lib/sqlite3/dbapi2.py#L66) ignores the time zone even if it is present and always returns a naive datetime object.

I think that the converter should return an aware object if the time zone is present in the database. As it is, round trips of TIMESTAMP values from the database to Python and back might erase the original time zone info.

Now that datetime.datetime.fromisoformat is in Python 3.7, this should be easy to implement.

----------
components: Library (Lib)
messages: 402979
nosy: iafisher
priority: normal
severity: normal
status: open
title: Default TIMESTAMP converter in sqlite3 ignores time zone
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45335>
_______________________________________


More information about the New-bugs-announce mailing list