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

bpo-24139: Add support for SQLite extended result codes by erlend-aasland · Pull Request #28076 · python/cpython · GitHub

Repository navigation

bpo-24139: Add support for SQLite extended result codes - #28076

Merged
pablogsal merged 23 commits into
python:mainfrom
erlend-aasland:sqlite-extended-error-codes
Nov 2, 2021
Merged

pablogsal merged 23 commits into
python:mainfrom
erlend-aasland:sqlite-extended-error-codes

Conversation

erlend-aasland commented Aug 30, 2021 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

This PR uses a different approach than Aviv's proposed patch in bpo. I use sqlite3_errcode() to fetch the exception class, and sqlite3_extended_errcode() to set the exception attributes. IMO, this is clearer and more future proof than using a mask in get_exception_class().

erlend-aasland force-pushed the sqlite-extended-error-codes branch from a4daae8 to 0275ffd Compare August 30, 2021 21:46
erlend-aasland marked this pull request as draft August 30, 2021 22:28

dimaqq commented Aug 31, 2021

Copy link
Copy Markdown
Contributor

from the tests:

Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/sqlite3/test/dbapi.py", line 276, in test_error_code_on_exception
    err_code = SQLITE_CANTOPEN
               ^^^^^^^^^^^^^^^
NameError: name 'SQLITE_CANTOPEN' is not defined

erlend-aasland commented Aug 31, 2021 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

@dimaqq:

NameError: name 'SQLITE_CANTOPEN' is not defined

Yes, SQLITE_CANTOPEN_ISDIR is returned on Windows and if forgot to prefix it with sqlite.. But, I need to revisit the extended result code ifdefs anyway, so I've marked this PR as draft for now.

erlend-aasland marked this pull request as ready for review August 31, 2021 13:07

Copy link
Copy Markdown
Contributor Author

PTAL, @dimaqq :)

erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 1, 2021

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 63347d8 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 1, 2021

erlend-aasland commented Sep 8, 2021 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

The AMD64 Arch Linux Asan Debug PR buildbot failure is unrelated. See python/buildmaster-config#275

Comment thread Modules/_sqlite/module.c
Erlend E. Aasland added 8 commits September 20, 2021 13:08
SQLITE_CONSTRAINT_ROWID, SQLITE_READONLY_DBMOVED, and SQLITE_AUTH_USER
The SQLITE_RANGE error indices that the parameter number argument to one
of the sqlite3_bind routines or the column number in one of the
sqlite3_column routines is out of range.  This should be considered a
misuse of the SQLite API, so we translate it to InterfaceError, as
defined by PEP 249.

Copy link
Copy Markdown
Contributor Author

Let me know if you have further remarks, @pablogsal :)

pablogsal merged commit 456e27a into python:main Nov 2, 2021
erlend-aasland deleted the sqlite-extended-error-codes branch November 2, 2021 23:50

This comment has been minimized.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL