Skip to content
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-44839: Raise more specific errors in sqlite3 #27613

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 5, 2021

MemoryError raised in user-defined function will now preserve
its type. OverflowError will now be converted to DataError.
Previously both were converted to OperationalError.

https://bugs.python.org/issue44839

MemoryError raised in user-defined function will now preserve
its type. OverflowError will now be converted to DataError.
Previously both were converted to OperationalError.
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor adjustments. This is a nice refactoring. These changes will greatly simplify GH-27456. Thanks!

Modules/_sqlite/connection.c Outdated Show resolved Hide resolved
Modules/_sqlite/connection.c Outdated Show resolved Hide resolved
Copy link
Member Author

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review. It is always good to have a second pair of eyes.

Modules/_sqlite/connection.c Outdated Show resolved Hide resolved
Modules/_sqlite/connection.c Outdated Show resolved Hide resolved
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks :)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@serhiy-storchaka serhiy-storchaka merged commit 7d747f2 into python:main Aug 6, 2021
@serhiy-storchaka serhiy-storchaka deleted the sqlite-python-to-sqlite-errors branch August 6, 2021 18:28
erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull request Jan 30, 2022
pythonGH-27613 (bpo 44839) was not backported, so exceptions differ between
main (3.11) and older versions.
JelleZijlstra pushed a commit that referenced this pull request Feb 21, 2022
…1030)

* [3.10] bpo-43853: Expand test suite for SQLite UDF's (GH-27642).
(cherry picked from commit 3eb3b4f)

Co-authored-by: Erlend Egeberg Aasland <[email protected]>

* Fix test_func_return_too_large_int

GH-27613 (bpo 44839) was not backported, so exceptions differ between
main (3.11) and older versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants