This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author plemarre
Recipients loewis, plemarre
Date 2012-08-03.08:27:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343982422.69.0.920992443085.issue15545@psf.upfronthosting.co.za>
In-reply-to
Content
I use Python 3.2.3 on GNU/Linux 64bits (openSUSE 12.2).
I have created an in-memory connection with the following code:

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
    for table_name, type, sql in sorted(schema_res.fetchall()):
TypeError: unorderable types: sqlite3.Row() < sqlite3.Row()

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
History
Date User Action Args
2012-08-03 08:27:02plemarresetrecipients: + plemarre, loewis
2012-08-03 08:27:02plemarresetmessageid: <1343982422.69.0.920992443085.issue15545@psf.upfronthosting.co.za>
2012-08-03 08:27:02plemarrelinkissue15545 messages
2012-08-03 08:27:01plemarrecreate