[issue29099] sqlite3 timestamp converter cannot handle timezone

Hassanbot report at bugs.python.org
Thu Sep 17 17:51:20 EDT 2020


Hassanbot <gris_martin at hotmail.com> added the comment:

This still isn't fixed as of 3.8 (or in master I think).

I can understand why you wouldn't want to allow serializing and deserializing time zones, since tzinfo objects cannot be accurately serialized with a simple UTC offset, but you should at least get an error when trying to insert an aware object. Anything is better than it is now, where you get no warning or error when inserting the object, and get a hard to interpret error ("invalid literal for int() with base 10") when trying to retrieve it.

For deserialization, the datetime class now (since 3.7) includes a fromisoformat() method that could be used as a counterpart to the isoformat() method used when serializing. At least it would be consistent then.

----------
nosy: +hassanbot
versions: +Python 3.8 -Python 3.7

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


More information about the Python-bugs-list mailing list