New submission from Ian Fisher :
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
Ian Fisher added the comment:
Substitute "UTC offset" for "time zone" in my comment above.
I have attached a minimal Python program demonstrating data loss from this bug.
--
Added file: https://bugs.python.org/file50324/timestamp.py
__
Ian Fisher added the comment:
Unfortunately fixing this will have to be considered a backwards-incompatible
change, since Python doesn't allow naive and aware datetime objects to be
compared, so if sqlite3 starts returning aware datetimes, existing code might
break.
Alternatively, pe
Ian Fisher added the comment:
> Another option could be to deprecate the current behaviour and then change it
> to being timezone aware in Python 3.13.
This sounds like the simplest option.
I'd be interested in working on this myself, if you think it's something tha
Ian Fisher added the comment:
Okay, I started a discussion here:
https://discuss.python.org/t/fixing-sqlite-timestamp-converter-to-handle-utc-offsets/10985
--
___
Python tracker
<https://bugs.python.org/issue45
Change by Ian Fisher :
--
nosy: +iafisher
___
Python tracker
<https://bugs.python.org/issue26651>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ian Fisher :
--
nosy: +iafisher
___
Python tracker
<https://bugs.python.org/issue19065>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Ian Fisher :
--
keywords: +patch
pull_requests: +27469
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29200
___
Python tracker
<https://bugs.python.org/issu
New submission from Ian Fisher :
Per discussion at
https://discuss.python.org/t/fixing-sqlite-timestamp-converter-to-handle-utc-offsets/,
the default converters in SQLite3 have several bugs and are probably not worth
continuing to maintain, so I propose deprecating them and removing them in
Ian Fisher added the comment:
See also bpo-26651 for a related proposal to deprecate the converter/adapter
infrastructure entirely.
The proposal in this bug is more limited: remove the default converters (though
I think the default adapters should stay), but continue to allow users to
Ian Fisher added the comment:
See bpo-45858 for a more limited proposal to only deprecate the default
converters.
--
___
Python tracker
<https://bugs.python.org/issue26
Ian Fisher added the comment:
I think it would also be helpful to make the examples at the top simpler/more
idiomatic, e.g. using a context manager for the connection and calling
conn.execute directly instead of spawning a cursor.
I think the information about the isolation_level parameter
12 matches
Mail list logo