Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-42213: Check connection in sqlite3.Connection.__enter__#26512

Merged
vstinner merged 2 commits into
python:mainpython/cpython:mainfrom
erlend-aasland:sqlite-improve-closeerlend-aasland/cpython:sqlite-improve-closeCopy head branch name to clipboard
Jun 3, 2021
Merged

bpo-42213: Check connection in sqlite3.Connection.__enter__#26512
vstinner merged 2 commits into
python:mainpython/cpython:mainfrom
erlend-aasland:sqlite-improve-closeerlend-aasland/cpython:sqlite-improve-closeCopy head branch name to clipboard

Conversation

@erlend-aasland

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

Copy link
Copy Markdown
Contributor
  • 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
Copy Markdown
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
Comment thread Lib/sqlite3/test/dbapi.py
@vstinner vstinner merged commit 82ad22a into python:main Jun 3, 2021
@vstinner

vstinner commented Jun 3, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.