Dec-16-2022, 05:13 AM
(This post was last modified: Dec-16-2022, 05:20 AM by deanhystad.)
Quote:fetchone()row_factor is None because NO MORE DATA IS AVAILABLE. Maybe there never was any data to start with, or maybe you already retrieved all the data. I'm guessing the former looking at your code. It doesn't matter the reason why, what matters is that the documentation for fetch_one() says that it might return None, and your program does nothing to prevent that highly likely possibility from crashing the program.
If row_factory is None, return the next row query result set as a tuple. Else, pass it to the row factory and return its result. Return None if no more data is available.