Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-105539: Emit ResourceWarning if sqlite3 database is not closed explicitly#108015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-105539: Emit ResourceWarning if sqlite3 database is not closed explicitly#108015
Uh oh!
There was an error while loading.Please reload this page.
Conversation
erlend-aasland commentedAug 16, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@vstinner: with this PR, sqlite3 emits a ResourceWarning if As you can see from the test changes, we've been pretty lax with resource handling in the sqlite3 test suite 😆 UPDATE: Tests updated ingh-108017 |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
cc.@felixxm |
cc.@simonw |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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).
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. |
Note: I intend to add ResourceWarnings in case |
This change doesn't break anything important in Django 👍 (at the first glance). I've started fixing |
Great, thanks for chiming in. |
Thanks for the reviews! |
Congrats :-) IMO it's a nice enhancement. |
Uh oh!
There was an error while loading.Please reload this page.
- 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_supportCheck outpython/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_supportCheck outpython/cpython#108015.
Uh oh!
There was an error while loading.Please reload this page.
📚 Documentation preview 📚:https://cpython-previews--108015.org.readthedocs.build/