FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-69093: improve sqlite3.Connection.blobopen() error handling by erlend-aasland · Pull Request #91571 · python/cpython · GitHub

Repository navigation

gh-69093: improve sqlite3.Connection.blobopen() error handling - #91571

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
erlend-aasland:sqlite-blob-misuse
Apr 15, 2022
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
erlend-aasland:sqlite-blob-misuse

Conversation

erlend-aasland commented Apr 15, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor

Unless sqlite3_blob_open() returns SQLITE_MISUSE, the error code and
message are available on the connection object. This means we have to
handle SQLITE_MISUSE error messages explicitly.

gh-69093

Unless sqlite3_blob_open() returns SQLITE_MISUSE, the error code and
message are available on the connection object. This means we have to
handle SQLITE_MISUSE error messages explicitly.

Copy link
Copy Markdown
Contributor Author

I noticed this comment in the sqlite3_blob_open docs:

Unless it returns SQLITE_MISUSE, this function sets the database connection error code and message accessible via sqlite3_errcode() and sqlite3_errmsg() and related functions.

_pysqlite_seterror uses the error code/message that is set on the connection object, so we need to handle the SQLITE_MISUSE case explicitly. Unfortunately (or luckily), there is no way for us to force such an error, so we cannot add a unit test for this.

erlend-aasland commented Apr 15, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

This reminds me that we need to map SQLITE_MISUSE to InterfaceError iso. ProgrammingError. But that belongs to issue #89022.

UPDATE, see gh-91572.

JelleZijlstra merged commit c06a4ff into python:main Apr 15, 2022
erlend-aasland deleted the sqlite-blob-misuse branch April 15, 2022 17:29
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL