Currently, sqlite3 does not correctly update the internal state of a Connection object if __init__ is called a second time and fails (e.g., due to an OperationalError).
Expected Behavior
If Connection.__init__ fails (even on an already open connection), the object should be considered uninitialized. Subsequent attempts to use methods like executemany should raise a sqlite3.ProgrammingError with the message "Base Connection.init not called", matching CPython's behavior.
Context
This behavior is required to pass test_connection_bad_reinit. We need to ensure the connection's initialized flag is reset or checked properly when re-initialization fails.
Currently,
sqlite3does not correctly update the internal state of aConnectionobject if__init__is called a second time and fails (e.g., due to anOperationalError).Expected Behavior
If
Connection.__init__fails (even on an already open connection), the object should be considered uninitialized. Subsequent attempts to use methods likeexecutemanyshould raise asqlite3.ProgrammingErrorwith the message "Base Connection.init not called", matching CPython's behavior.Context
This behavior is required to pass
test_connection_bad_reinit. We need to ensure the connection's initialized flag is reset or checked properly when re-initialization fails.