]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42213: Check connection in sqlite3.Connection.__enter__ (GH-26512)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Thu, 3 Jun 2021 15:53:47 +0000 (17:53 +0200)
committerGitHub <noreply@github.com>
Thu, 3 Jun 2021 15:53:47 +0000 (17:53 +0200)
commit82ad22a97d4b5d7134424f12bd6a61167db7f4f8
tree753b308bddf46e8b6ea4d468539a237601e8ece7
parent937cebc93b4922583218e0cbf0a9a14705a595b2
bpo-42213: Check connection in sqlite3.Connection.__enter__ (GH-26512)

Try to harden connection close:

- 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
Lib/sqlite3/test/dbapi.py
Modules/_sqlite/connection.c