-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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-16379: expose SQLite error codes and error names in sqlite3
#27786
Merged
pablogsal
merged 34 commits into
python:main
from
erlend-aasland:sqlite-expose-error-code
Aug 30, 2021
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
83ab267
sqlite3 module expose sqlite error code and name in exceptions
palaviv eeb10f4
Fix syntax error
palaviv 42636f9
Add NEWS entry
palaviv f224223
Update version
palaviv 31467e3
Fix whitespace
palaviv 679280d
Merge branch 'main' into sqlite-expose-error-code
8aa0859
Move exception documentation to the exceptions section
e4195c0
Use PyModule_AddObjectRef to add error codes
a4a0762
Refactor: add add_error_constants()
c18d227
Sort error codes alphabetically
67e49e8
Normalise style with the rest of the code base (PEP 7, etc.)
1893ced
Improve "get error name" function
67ea5f2
Refactor _pysqlite_seterror changes
6ced38c
Refactor error code table
467f7ba
Use macro to create error table
4abd093
Add missing SQLITE_NOTICE and SQLITE_WARNING codes
70507dd
Add comment
b617192
Merge branch 'main' into sqlite-expose-error-code
db053b9
Assert exception class is always set
98106dd
Use explicit API's iso. Py_BuildValue, etc.
0567938
Remove duplicate return code entries
16889a1
Group stuff
a7a1cf8
Use 'unknown' when a proper SQLite exception cannot be found
772a29c
Fix complete_statement.py example
fa5a1af
Improve unit tests
cf551b1
Adjust NEWS entry and update What's New
a3646c9
Use PyObject_SetAttrString iso. _PyObject_SetAttrId => slow path/read…
8a49659
Refactor _pysqlite_seterror
8d11bc5
Link to sqlite.org/rescode.html iso. sqlite.org/c3ref/c_abort.html
7a69798
Use test.support.os_helper.temp_dir() in test_error_code_on_exception()
b9a5a77
Merge branch 'main' into sqlite-expose-error-code
3589a6a
Address review: document get_exception_class() return value
a3c45b6
Merge branch 'main' into sqlite-expose-error-code
5a5683c
Address review: compare char ptr with NULL iso. 0
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2019-05-08-15-14-32.bpo-16379.rN5JVe.rst
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Add SQLite error code and name to :mod:`sqlite3` exceptions. | ||
Patch by Aviv Palivoda, Daniel Shahaf, and Erlend E. Aasland. |
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slighly confusing because normally returning
NULL
signifies an error. Could you please document this both on the call site and in this function? Otherwise the call site reads weirdly becauseseems that is handling an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I see now that it can be a bit confusing. I'll add a comment. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it clearer with 3589a6a?
(FYI, I need to rebase ontomain
again bco. GH-26202)