Skip to content

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-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
ContributorAuthor

Ref. #26462 (comment)

@erlend-aaslanderlend-aasland changed the title bpo-42213: Refactor sqlite3 connection closebpo-42213: Check connection in sqlite3.Connection.__enter__Jun 3, 2021
@vstinnervstinner merged commit 82ad22a into python:mainJun 3, 2021
@vstinner
Copy link
Member

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

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

Thanks for reviewing, Victor!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@vstinner@the-knights-who-say-ni@bedevere-bot