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

Bug #545104 reported by Dave Flitney on 2010-03-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone
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
In main!
Traceback (most recent call last):
  File "", line 46, in ?
  File "", 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'


Related branches

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

IterWrapper expects an iterator object.

iw = oursql.IterWrapper([u'foo', u'bar'])
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