GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python3.11: sqlite3.connect passes more arguments to factory() · Issue #95132 · python/cpython Closed Labels 3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-sqlite3triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionHello, Bug report Consider the following code snippet: $ cat /tmp/test.py import sqlite3 class SqliteConnection(sqlite3.Connection): def __init__(self, *args, **kwargs): print(args) print(kwargs) super(SqliteConnection, self).__init__(*args, **kwargs) db_path = '/tmp/foo.db' sqlite3.connect(db_path, factory=SqliteConnection) And the execution: $ python3.10 /tmp/test.py ('/tmp/foo.db',) {'factory': <class '__main__.SqliteConnection'>} $ python3.11 /tmp/test.py ('/tmp/foo.db', 5.0, 0, '', 1, <class '__main__.SqliteConnection'>, 128, 0) {} The default values of sqlite3.connect's arguments are passed to the factory in $ cat /tmp/failure.py import sqlite3 class SqliteConnection(sqlite3.Connection): def __init__(self, *args, **kwargs): kwargs['timeout'] = 42 super(SqliteConnection, self).__init__(*args, **kwargs) db_path = '/tmp/foo.db' sqlite3.connect(db_path, factory=SqliteConnection) $ python3.10 /tmp/failure.py $ $ python3.11 /tmp/failure.py Traceback (most recent call last): File "/tmp/failure.py", line 11, in <module> sqlite3.connect(db_path, factory=SqliteConnection) File "/tmp/failure.py", line 7, in __init__ super(SqliteConnection, self).__init__(*args, **kwargs) TypeError: Connection() takes at most 8 arguments (9 given) Your environment It was mentioned in #93044 (see the Reacted by Erlend E. Aasland Activity
MetadataMetadataAssigneesLabels3.11only security fixesonly security fixes3.12only security fixesonly security fixestopic-sqlite3triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error Projects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |