Python – TypeError: ‘NoneType’ object is not iterable


I need to process mysql data one row at a time and i have selected all rows put them in a tuple but i get the error above.

what does this mean and how do I go about it?

Best Answer

  1. Provide some code.
  2. You probably call some function that should update database, but the function does not return any data (like cursor.execute()). And code:

    data = cursor.execute()

    Makes data a None object (of NoneType). But without code it's hard to point you to the exact cause of your error.