[New-bugs-announce] [issue44859] Improve some sqlite3 errors

Serhiy Storchaka report at bugs.python.org
Sat Aug 7 10:14:16 EDT 2021


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

* MemoryError is now raised instead of sqlite3.Warning when memory is not enough for encoding statement to UTF-8 in Connection.__call__() and Cursor.execute().
* UnicodEncodeError is now raised instead of sqlite3.Warning when statement contains surrogate characters in Connection.__call__() and Cursor.execute().
* TypeError is now raised instead of ValueError for non-string script in Cursor.execute().
* ValueError is now raised for script containing NUL instead of truncating it in Cursor.execute().
* Correctly handled exceptions raised when getting boolean value of the result of the progress handler to bool.

Also added many tests which cover different exceptional cases.

----------
components: Extension Modules
messages: 399183
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve some sqlite3 errors
versions: Python 3.11

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


More information about the New-bugs-announce mailing list