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
sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row #59750
Comments
Can you please elaborate? Structure your report as follows:
|
I use Python 3.2.3 on GNU/Linux 64bits (openSUSE 12.2). conn = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES, check_same_thread=False)
conn.row_factory = sqlite3.Row Then I have filled the database, but when it comes to copy it via conn.iterdump(), it crashed with the following message: File "/usr/lib64/python3.2/sqlite3/dump.py", line 30, in _iterdump It seems that the error appears because of the use of "sorted()". In fact, if I don't change conn.row_factory or if I use a custom class _Row implementing __lt__ method (see below) this error does not appear. class _Row(sqlite3.Row):
def __lt__(self, x):
return False |
By the way, this issue does not appear with Python 3.2.2. |
Here's a minimal fix that modifies the sql in sqlite3.dump._iterdump() to sort the tables by name. It is then no longer necessary to sort the resultset in Python for the unit tests to pass. |
Thanks for the patch. In which version will be your patch integrated? |
For the record, this is a regression introduced by the fix for bpo-9750. I plan to commit the fix shortly, thanks for the report and patch. |
New changeset 2cdb599172ab by R David Murray in branch '3.2': New changeset 6a85894c428f by R David Murray in branch '3.3': New changeset 7a62b5ee32ec by R David Murray in branch 'default': New changeset bb4e4f0cec2e by R David Murray in branch '2.7': |
Peter, I see you've made contributions before, but you don't show as having a contributor agreement on file according to the tracker. Have you sent one in? If not, would you, please? Thanks again for the fix. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: