I am trying to get the rowcount of a sqlite3 cursor in my Python3k program, but I am puzzled, as the rowcount is always -1, despite what Python3 docs say (actually it is contradictory, it should be None). Even after fetching all the rows, rowcount stays at -1. Is it a sqlite3 bug? I have already checked if there are rows in the table.
I can get around this checking if a fetchone() returns something different than None, but I thought this issue would be nice to discuss.
Thanks.
mysql.connectorthe rowcount attribute is -1 after an .execute call of a SELECT-statement, but after the fetchall() call the actual number of rows in thefetched data is returned. Just an observation... - Duffau