BinaryWrappers do not work

Bug #737945 reported by Jasiel Spelman on 2011-03-19
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

BinaryWhateverMixins do not work:

>>> oursql.BinaryIterWrapper( ['\x00'] ).next()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "statement.pyx", line 14, in oursql._BinaryWhateverMixin.__next__ (oursqlx/oursql.c:6562)
TypeError: super(type, obj): obj must be an instance or subtype of type

As a work around, I've found I can use just buffer() items before they get into the iterable:
>>> oursql.IterWrapper( [buffer('\x00')] ).next()
<read-only buffer for 0x7f16efc27210, size -1, offset 0 at 0x1555130>

This occurs on 0.9.2

description: updated
Chad Parry (sp9m) wrote :

The error manifested itself a little differently on my platform:

  File "statement.pyx", line 14, in oursql._BinaryWhateverMixin.__next__ (oursqlx/oursql.c:7195)
  File "statement.pyx", line 14, in oursql._BinaryWhateverMixin.__next__ (oursqlx/oursql.c:7195)
  RuntimeError: maximum recursion depth exceeded while calling a Python object

The problem is that the code calls "super" for the wrong class name. This typo has been present since the first revision where those helpers were introduced, (

The patch is a simple name change. I've attached the fix.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers