-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-44859: Raise more accurate exceptions in sqlite3
#27695
Conversation
If SQLITE_MISUSE is raised, it is a sqlite3 module bug. Users of the sqlite3 module are not responsible of using the SQLite C API correctly.
608f9fe
to
f9a5dc6
Compare
@serhiy-storchaka would you mind reviewing this? |
Failure to do so, will result in an assertion failure / segfault.
@serhiy-storchaka PTAL. I just fixed bug in |
@malemburg would you mind taking a look at this PR? I'm slowly trying to align the exceptions raised with PEP 249. |
Misc/NEWS.d/next/Library/2021-08-10-00-05-53.bpo-44859.9e9_3V.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Library/2021-08-10-00-05-53.bpo-44859.9e9_3V.rst
Outdated
Show resolved
Hide resolved
Looks like you didn't push the changes I previously asked for. |
Actually, it seems I forgot about this; I didn't make any changes yet :) I'll see if I can get to it any time soon. Thanks for the reminder! |
I'd like to run this through the Django test suite before eventually merging. Also, I'll have a talk with MAL regarding this change. |
I finally got to run this through the Django test suite, and it works all fine; one down, one to go. Observations while running the Django test suiteI got sidetracked with a long bisect operation because I was using SQLite 3.39.0 (development version), and because b899126 produces a ton of warnings in the Django test suite. I reverted b899126 and compiled strictly against SQLite 3.36.0 (macOS bundled), and all was ok. UPDATE: I had a chat the other day with @malemburg, to get his comments regarding three specific DB-API related changes in this PR. I take the liberty to quote him here (hope that's ok, Marc-Andre):
I will update the PR with the suggested change. |
Improve exception compliancy with PEP 249
If SQLITE_MISUSE is raised, it is a sqlite3 module bug. Users of the
sqlite3 module are not responsible of using the SQLite C API correctly.
than one SQL statement.
_pysqlite_set_result
raises an exception if it returns -1.Fixes #89022