[New-bugs-announce] [issue46662] Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp

Bo-wei Chen report at bugs.python.org
Sun Feb 6 14:03:59 EST 2022


New submission from Bo-wei Chen <rayologist1002 at gmail.com>:

convert_timestamp function in Lib/sqlite3/dbapi2.py fails to parse a timestamp correctly, if it does not have microseconds but comes with timezone information, e.g. b"2022-02-01 16:09:35+00:00"

Traceback:

Traceback (most recent call last):
  File "/Users/user/Desktop/test.py", line 121, in <module>
    convert_timestamp(b"2022-02-01 16:09:35+00:00")
  File "/Users/user/Desktop/test.py", line 112, in convert_timestamp
    hours, minutes, seconds = map(int, timepart_full[0].split(b":"))
ValueError: invalid literal for int() with base 10: b'35+00'

----------
components: Library (Lib)
messages: 412655
nosy: Rayologist
priority: normal
severity: normal
status: open
title: Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp
type: behavior
versions: Python 3.9

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


More information about the New-bugs-announce mailing list