GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-24139: Add support for SQLite extended result codes by erlend-aasland · Pull Request #28076 · python/cpython

Conversation

@erlend-aasland

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

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

https://bugs.python.org/issue24139

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@erlend-aasland
erlend-aasland requested a review from berkerpeksag as a code owner August 30, 2021 21:11
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Aug 30, 2021
@bedevere-bot bedevere-bot added the awaiting review label Aug 30, 2021
@erlend-aasland

erlend-aasland commented Aug 30, 2021

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().

dimaqq reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland requested a review from pablogsal August 30, 2021 21:19
Erlend E. Aasland added 5 commits August 30, 2021 23:45
Erlend E. Aasland
Add extended result codes as module constants
b263f0f
Erlend E. Aasland
Use extended result code to add exception attributes
c8c0e96
Erlend E. Aasland
Add ifdefs for extended error codes
9c08365
Erlend E. Aasland
Add test for extended error codes
8db2828
Erlend E. Aasland
Add NEWS item
0275ffd
@erlend-aasland
erlend-aasland force-pushed the sqlite-extended-error-codes branch from a4daae8 to 0275ffd Compare August 30, 2021 21:46
@erlend-aasland
erlend-aasland marked this pull request as draft August 30, 2021 22:28
Erlend E. Aasland
Fix windows tests
0e95901
@dimaqq

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Aug 31, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland added 3 commits August 31, 2021 09:16
Erlend E. Aasland
Fix ifdefs for extended result codes
0a2efd9
Erlend E. Aasland
Fix tests again
b1a2625
Erlend E. Aasland
Add extended error codes from upcoming SQLite 3.37.0
a30ffb3
@erlend-aasland
erlend-aasland marked this pull request as ready for review August 31, 2021 13:07
@erlend-aasland

erlend-aasland commented Aug 31, 2021

Copy link
Copy Markdown
Contributor Author

PTAL, @dimaqq :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland
Squeeze a couple of lines in test_module_constants()
63347d8
@erlend-aasland erlend-aasland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 1, 2021
@bedevere-bot

bedevere-bot commented 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

erlend-aasland commented Sep 8, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland
Merge branch 'main' into sqlite-extended-error-codes
988d7cc
pablogsal
pablogsal approved these changes Sep 19, 2021
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Sep 19, 2021
pablogsal
pablogsal reviewed Sep 19, 2021
View reviewed changes
Comment thread Modules/_sqlite/module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland
Address review: add link to SQLite docs
fbc1526
@erlend-aasland
erlend-aasland requested a review from pablogsal September 19, 2021 23:02
Erlend E. Aasland added 8 commits September 20, 2021 13:08
Erlend E. Aasland
Add links to SQLite release docs
8e6c58c
Erlend E. Aasland
Fix #if's for error codes between SQLite 3.8.2 and 3.8.10
a36a6b9
SQLITE_CONSTRAINT_ROWID, SQLITE_READONLY_DBMOVED, and SQLITE_AUTH_USER
Erlend E. Aasland
Add support for the SQLITE_RANGE primary result code
59da713
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.
Erlend E. Aasland
Fix test_extended_error_code_on_exception version requirement
f6a9bbe
Erlend E. Aasland
What's New
933f57b
Erlend E. Aasland
Use managed connect in the added test
631e4d5
Erlend E. Aasland
Merge branch 'main' into sqlite-extended-error-codes
54b1ceb
Erlend E. Aasland
Improve comment
26517fc
@erlend-aasland

erlend-aasland commented Oct 19, 2021

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland added 3 commits November 1, 2021 11:02
Erlend E. Aasland
Merge branch 'main' into sqlite-extended-error-codes
b01303a
Erlend E. Aasland
Remove 3.37.0 (dev) error codes. 3.37 is still in development
1f39d8d
Erlend E. Aasland
Remove dev (3.37.0) flags from tests as well
3cb5998
@pablogsal
pablogsal merged commit 456e27a into python:main Nov 2, 2021
@bedevere-bot bedevere-bot removed the awaiting merge label Nov 2, 2021
@erlend-aasland
erlend-aasland deleted the sqlite-extended-error-codes branch November 2, 2021 23:50
@bedevere-bot

This comment has been minimized.

Sign in to view
@erlend-aasland erlend-aasland mentioned this pull request Nov 3, 2021
bpo-24139: Fix sqlite3 test suite on s390x RHEL buildbots #29382
Merged
@The-Compiler The-Compiler mentioned this pull request May 23, 2022
test_sqlite3.test_dbapi: Extended error codes aren't actually tested #93115
Closed
@eric-eclecticiq eric-eclecticiq mentioned this pull request Dec 21, 2023
Fix broken 3.8 SQLite test pipeline eclecticiq/OpenTAXII#266
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
@pablogsal pablogsal Awaiting requested review from pablogsal

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@erlend-aasland @dimaqq @bedevere-bot @pablogsal @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.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.Add this suggestion to a batch that can be applied as a single commit.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.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.