| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@vstinner: with this PR, sqlite3 emits a ResourceWarning if close() was not called explicitly on a sqlite3.Connection object before it is deleted. I did not (yet) add a resource warning for the case where close fails (future enhancement). As you can see from the test changes, we've been pretty lax with resource handling in the sqlite3 test suite 😆 UPDATE: Tests updated in gh-108017 |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. This change does what it says. There is room for enhancement, but it can be addressed separately (@erlend-aasland already creates issues to track remaining points).
Sorry, something went wrong.
|
Thanks for the review, Victor! I asked about #108015 (comment) on the core dev Discord. If it is an issue, we can fix it later. |
Sorry, something went wrong.
|
Note: I intend to add ResourceWarnings in case sqlite3_close*() fails as well, but I will do that in a follow-up PR. Currently, the sqlite3 module asserts that sqlite3_close*() did not fail, which is not optimal. |
Sorry, something went wrong.
This change doesn't break anything important in Django 👍 (at the first glance). I've started fixing ResourceWarnings in our tests, check out django/django#17178. |
Sorry, something went wrong.
Great, thanks for chiming in. |
Sorry, something went wrong.
|
Thanks for the reviews! |
Sorry, something went wrong.
|
Congrats :-) IMO it's a nice enhancement. |
Sorry, something went wrong.
- backends.sqlite.tests.ThreadSharing.test_database_sharing_in_threads
- backends.tests.ThreadTests.test_default_connection_thread_local:
on SQLite, close() doesn't explicitly close in-memory connections.
- servers.tests.LiveServerInMemoryDatabaseLockTest
- test_runner.tests.SQLiteInMemoryTestDbs.test_transaction_support
Check out python/cpython#108015.
- backends.sqlite.tests.ThreadSharing.test_database_sharing_in_threads
- backends.tests.ThreadTests.test_default_connection_thread_local:
on SQLite, close() doesn't explicitly close in-memory connections.
- servers.tests.LiveServerInMemoryDatabaseLockTest
- test_runner.tests.SQLiteInMemoryTestDbs.test_transaction_support
Check out python/cpython#108015.
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--108015.org.readthedocs.build/