When fetchmany() is executed on an exhausted record set, the following error occurs:
TypeError: 'NoneType' object is not iterable
Here is a test case:
conn = DB2.conn(...)
cur = conn.cursor()
cur.execute("create table test (C1 BIGINT)")
cur.execute("insert into test values (1)")
cur.execute("select * from test")
cur.fetchmany()
cur.fetchmany()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\python25\lib\site-packages\DB2.py", line 216, in fetchmany
return self._convert_result_rows(rlist)
File "c:\python25\lib\site-packages\DB2.py", line 193, in _convert_result_rows
for r in rows:
TypeError: 'NoneType' object is not iterable
Should be simply a matter of checking if rows is None in _convert_result_rows().