[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-03 Thread Pierre Le Marre

Changes by Pierre Le Marre :


--
components: None
nosy: plemarre
priority: normal
severity: normal
status: open
title: sqlite3.Connection.iterdump() does not work with row_factory = 
sqlite3.Row
type: crash
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-03 Thread Martin v . Löwis

New submission from Martin v. Löwis:

Can you please elaborate? Structure your report as follows:

1. this is what I did
2. this is what happened
3. this is what should have happened instead.

--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-03 Thread Pierre Le Marre

Pierre Le Marre added the comment:

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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-06 Thread Pierre Le Marre

Pierre Le Marre added the comment:

By the way, this issue does not appear with Python 3.2.2.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-06 Thread Peter Otten

Peter Otten added the comment:

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.

--
keywords: +patch
nosy: +peter.otten
Added file: http://bugs.python.org/file26710/iterdump.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-09-21 Thread Pierre Le Marre

Pierre Le Marre added the comment:

Thanks for the patch. In which version will be your patch integrated?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

For the record, this is a regression introduced by the fix for issue 9750.  I 
plan to commit the fix shortly, thanks for the report and patch.

--
nosy: +r.david.murray
stage:  -> commit review
type: crash -> behavior
versions: +Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2013-01-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2cdb599172ab by R David Murray in branch '3.2':
#15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/2cdb599172ab

New changeset 6a85894c428f by R David Murray in branch '3.3':
merge #15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/6a85894c428f

New changeset 7a62b5ee32ec by R David Murray in branch 'default':
merge #15545: fix sqlite3.iterdump regression on unsortable row_factory objects.
http://hg.python.org/cpython/rev/7a62b5ee32ec

New changeset bb4e4f0cec2e by R David Murray in branch '2.7':
#15545: sort iterdump via SQL instead of in python code
http://hg.python.org/cpython/rev/bb4e4f0cec2e

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2013-01-10 Thread R. David Murray

R. David Murray added the comment:

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.

--
components: +Library (Lib) -None
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com