fetchone() does not follow pep-0249
Bug #454782 reported by
Mike Bayer
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Connector/Python |
Fix Released
|
Medium
|
Geert JM Vanderkelen |
Bug Description
the fetchone() method of cursor raises "InterfaceError: Fetched all rows already." when called with no further rows remaining. It should be returning None as per pep-0249:
.fetchone()
Fetch the next row of a query result set, returning a
single sequence, or None when no more data is
available. [6]
Test case:
from mysql import connector
conn = connector.
cursor = conn.cursor()
cursor.
# succeeds
assert cursor.fetchone() == (1,)
# fails
assert cursor.fetchone() is None
Related branches
tags: | added: cursor pep249 |
Changed in myconnpy: | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
Thanks for this report!
This will come in next push where I changed how rows are fetched.
There will be exception raised, but that's only when for example the connection died or no protocol was said. Things like that.