Can't get "Inserting large data sets" tutorial to work

Reported by Dave Flitney on 2010-03-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oursql
Medium
Aaron Gallagher

Bug Description

Was having trouble using the IterWrapper classes so tried to test with the tutorial example (see attached file). It fails with the following traceback:

[OVALTINE-VM6 flitney]# python oursqltest.py
In main!
Traceback (most recent call last):
  File "oursql_test.py", line 46, in ?
    db.insert_blobs();
  File "oursql_test.py", line 30, in insert_blobs
    iw = oursql.IterWrapper([u'foo', u'bar'])
  File "statement.pyx", line 30, in oursql.IterWrapper.__cinit__ (oursqlx/oursql.c:6429)
AttributeError: 'list' object has no attribute 'next'

Thanks,
Dave

Related branches

Dave Flitney (flitney) wrote :
Unode (simpledark+launchpad) wrote :

IterWrapper expects an iterator object.

Replace:
iw = oursql.IterWrapper([u'foo', u'bar'])
by:
iw = oursql.IterWrapper(iter([u'foo', u'bar']))

Aaron Gallagher (habnabit) wrote :

This is partly an oursql bug and partly a documentation bug. The correct behavior is what's listed in the documentation already; IterWrapper should take an iterable, not an iterator. I just forgot that I hadn't tested every snippet in the docs or I would've caught this sooner.

A fix is forthcoming.

Changed in oursql:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Aaron Gallagher (habnabit)
milestone: none → 0.9.2
Changed in oursql:
status: In Progress → Fix Committed
Changed in oursql:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments