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-42213: Check connection in sqlite3.Connection.__enter__ #26512

Merged
merged 2 commits into from Jun 3, 2021

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jun 3, 2021

  • add tests that exercise operations against a closed database
  • add utility wrapper for sqlite3_close_v2()
  • add connection sanity check on __enter__
  • simplify error handling; sqlite3_close_v2() always returns SQLITE_OK

https://bugs.python.org/issue42213

- add tests that exercise stuff against a closed database
- add wrapper for sqlite3_close_v2()
- check connection on __enter__
- explicitly free pending statements before close()
- sqlite3_close_v2() always returns SQLITE_OK
@erlend-aasland
Copy link
Contributor Author

Ref. #26462 (comment)

@erlend-aasland erlend-aasland changed the title bpo-42213: Refactor sqlite3 connection close bpo-42213: Check connection in sqlite3.Connection.__enter__ Jun 3, 2021
@vstinner vstinner merged commit 82ad22a into python:main Jun 3, 2021
@vstinner
Copy link
Member

vstinner commented Jun 3, 2021

Merged, this change is atomic and remains useful, thanks!

@erlend-aasland erlend-aasland deleted the sqlite-improve-close branch June 3, 2021 16:00
@erlend-aasland
Copy link
Contributor Author

Thanks for reviewing, Victor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants