Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc06a4ff

Browse files
author
Erlend Egeberg Aasland
authored
gh-69093: improve sqlite3.Connection.blobopen() error handling (GH-91571)
Unless sqlite3_blob_open() returns SQLITE_MISUSE, the error code andmessage are available on the connection object. This means we have tohandle SQLITE_MISUSE error messages explicitly.
1 parent1b34b56 commitc06a4ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎Modules/_sqlite/connection.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,11 @@ blobopen_impl(pysqlite_Connection *self, const char *table, const char *col,
475475
rc=sqlite3_blob_open(self->db,name,table,col,row, !readonly,&blob);
476476
Py_END_ALLOW_THREADS
477477

478-
if (rc!=SQLITE_OK) {
478+
if (rc==SQLITE_MISUSE) {
479+
PyErr_Format(self->state->InterfaceError,sqlite3_errstr(rc));
480+
returnNULL;
481+
}
482+
elseif (rc!=SQLITE_OK) {
479483
_pysqlite_seterror(self->state,self->db);
480484
returnNULL;
481485
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp