Skip to content

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.

4 participants