]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-108083: Don't ignore exceptions in sqlite3.Connection.__init__() and .close...
authorErlend E. Aasland <erlend@python.org>
Sat, 19 Aug 2023 23:07:41 +0000 (01:07 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Aug 2023 23:07:41 +0000 (01:07 +0200)
commit0c21298f2bc17966498f13995586890488a6f8f1
tree87d22063726a8fe715064f415053e5bdb76b2bd8
parent41634edb2b54f488aac286b938a3590f5dac154c
[3.12] gh-108083: Don't ignore exceptions in sqlite3.Connection.__init__() and .close() (#108084) (#108141)

- Add explanatory comments
- Add return value to connection_close() for propagating errors
- Always check the return value of connection_exec_stmt()
- Assert pre/post state in remove_callbacks()
- Don't log unraisable exceptions in case of interpreter shutdown
- Make sure we're not initialized if reinit fails
- Try to close the database even if ROLLBACK fails

(cherry picked from commit fd195092204aa7fc9f13c5c6d423bc723d0b3520)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Misc/NEWS.d/next/Library/2023-08-17-12-59-35.gh-issue-108083.9J7UcT.rst [new file with mode: 0644]
Modules/_sqlite/connection.c