mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
sqlite3.iterdump() depends on the row factory returning resulting rows as tuples; it will fail with custom row factories like for example a dict factory. With this commit, we explicitly reset the row factory of the cursor used by iterdump(), so we always get predictable results. This does not affect the row factory of the parent connection. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
fc1732ce3f
commit
7a843e8390
3 changed files with 18 additions and 0 deletions
|
@ -18,6 +18,7 @@ def _iterdump(connection):
|
|||
|
||||
writeable_schema = False
|
||||
cu = connection.cursor()
|
||||
cu.row_factory = None # Make sure we get predictable results.
|
||||
yield('BEGIN TRANSACTION;')
|
||||
|
||||
# sqlite_master table contains the SQL CREATE statements for the database.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue