You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2021-04-14.11:23:31.401>created_at=<Date2021-04-06.18:29:34.231>labels= ['type-bug', 'library', '3.10']
title='[sqlite3] Fetching an empty value from date column raises ValueError'updated_at=<Date2021-04-14.11:23:31.401>user='https://github.com/felixxm'
We noticed a regression in Python3.10.0a7 (it works properly in Python3.10.0a6) when running Django's test suite. convert_date() is called and crashes when fetching an empty value from date column on SQLite:
File "python3.10/lib/sqlite3/dbapi2.py", line 64, in convert_date
return datetime.date(*map(int, val.split(b"-")))
ValueError: invalid literal for int() with base 10: b''
cur.execute("CREATE TABLE t (x DATE NULL)")
cur.execute("INSERT INTO t (x) VALUES (NULL)")
cur.execute("SELECT * FROM t")
values= [x forxincur.fetchall()]
Regression was introduced by e161ec5, where it was assumed that the handling of zero-sized blobs should be consistent. Unfortunately, the handling of zero-sized blobs is not consistent. Zero-sized blobs _with_ converters must return None; zero-sized blobs _without_ converters must return b"".