{{ message }}
bpo-44859: Improve error handling in sqlite3 and change some errors#27654
Merged
serhiy-storchaka merged 2 commits intoAug 8, 2021
Merged
bpo-44859: Improve error handling in sqlite3 and change some errors#27654serhiy-storchaka merged 2 commits into
serhiy-storchaka merged 2 commits into
Conversation
* MemoryError is now raised instead of sqlite3.Warning when memory is not enough for encoding a statement to UTF-8 in Connection.__call__() and Cursor.execute(). * UnicodEncodeError is now raised instead of sqlite3.Warning when the statement contains surrogate characters in Connection.__call__() and Cursor.execute(). * TypeError is now raised instead of ValueError for non-string script argument in Cursor.executescript(). * ValueError is now raised for script containing the null character instead of truncating it in Cursor.executescript(). * Correctly handle exceptions raised when getting boolean value of the result of the progress handler. * Add may tests covering different exceptional cases.
This was referenced Aug 7, 2021
erlend-aasland
left a comment
Contributor
There was a problem hiding this comment.
LGTM, in general. Region coverage for util.c is now above 80%; sqlite3 coverage is getting better and better.
I left some minor comments.
Sorry, something went wrong.
Contributor
|
BTW, that's a neat enhancement of the |
Sorry, something went wrong.
Contributor
|
We should consider changing some more errors, as discussed in #27642 (comment), #27645 (comment), and #27645 (comment) |
Sorry, something went wrong.
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
erlend-aasland
approved these changes
Aug 7, 2021
erlend-aasland
pushed a commit
to erlend-aasland/cpython
that referenced
this pull request
Aug 12, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
memory is not enough for encoding a statement to UTF-8
in Connection.call() and Cursor.execute().
the statement contains surrogate characters
in
Connection.__call__()and Cursor.execute().script argument in Cursor.executescript().
character instead of truncating it in Cursor.executescript().
of the result of the progress handler.
https://bugs.python.org/issue44859