[issue44859] Improve some sqlite3 errors

2022-03-16 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 4674fd4e938eb4a29ccd5b12c15455bd2a41c335 by Erlend Egeberg Aasland in branch 'main': bpo-44859: Raise more accurate exceptions in `sqlite3` (GH-27695) https://github.com/python/cpython/commit/4674fd4e938eb4a29ccd5b12c15455bd2a41c335 --

[issue44859] Improve some sqlite3 errors

2021-08-12 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Also, for SQLite 3.7.17 and above, we should raise sqlite3.Warning for error > codes SQLITE_NOTICE and SQLITE_WARNING. Er, forget that. Neither are returned by any SQLite C interface, at the moment. They can (currently) only be used as the first argumen

[issue44859] Improve some sqlite3 errors

2021-08-09 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26181 pull_request: https://github.com/python/cpython/pull/27695 ___ Python tracker ___ ___

[issue44859] Improve some sqlite3 errors

2021-08-09 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Also, for SQLite 3.7.17 and above, we should raise sqlite3.Warning for error codes SQLITE_NOTICE and SQLITE_WARNING. -- ___ Python tracker __

[issue44859] Improve some sqlite3 errors

2021-08-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: * sqlite3.ProgrammingError is raised for SQLITE_MISUSE. IMO, sqlite3.InterfaceError, is more appropriate. * In case of too large integer values, OverflowError is raised on bind, but sqlite3.DataError is raised on UDF return. Using sqlite3.DataError in both

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0eec6276fdcdde5221370d92b50ea95851760c72 by Serhiy Storchaka in branch 'main': bpo-44859: Improve error handling in sqlite3 and and raise more accurate exceptions. (GH-27654) https://github.com/python/cpython/commit/0eec6276fdcdde5221370d92b5

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Entries 3 and 4 are about Cursor.executescript(), not Cursor.execute(). -- ___ Python tracker ___ _

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +26148 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27654 ___ Python tracker ___

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is also a problem with the sqlite3.InterfaceError raised when bind parameters with message "Error binding parameter XXX - probably unsupported type." It is raised not only for unsupported types, but: * For too large integers (outside of the range of

[issue44859] Improve some sqlite3 errors

2021-08-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : * 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