behavior of an iterator in a Flask response
you could try and not close the file handle (then you would not open it with the context syntax but instead)
reader = csv.DictReader(open(csvfile,"rb"))def generate_all(): for row in reader: yield str(row)
....maybe ... im not sure since i have never used a generator like this ... as a flask response ...