-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-45126: Harden sqlite3
connection initialisation
#28227
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cc. @encukou — |
I've split this PR up in two:
|
This reverts commit 4b06443.
Sync with main bco. pythonGH-28231
sqlite3
connection initialisationsqlite3
connection initialisation
This PR is stale because it has been open for 30 days with no activity. |
I'm marking this as a draft until GH-29053 is merged. |
🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 257aba7 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Buildbot status:
|
@encukou, what do you think of this? |
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.
Should connection_close
set initialized = 0
?
I don't think it's possible to think about (and test) all reinitialization edge cases, but this PR is an improvement.
That would need further changes to cpython/Modules/_sqlite/connection.c Lines 433 to 452 in 6a84d61
As a further improvement, we could look into just using the database pointer for verifying if a connection object is usable or not. That is, get rid of
I agree with all of that. |
That sounds like a great idea, actually – less interdependent state to get out of sync! |
Thanks for reviewing and merging, Petr! |
__init__
with a known connection stateResolves #89289
https://bugs.python.org/issue45126