Catch error in a for loop python
问题 I have a for loop on an avro data reader object for i in reader: print i then I got a unicode decode error in the for statement so I wanted to ignore that particular record. So I did this try: for i in reader: print i except: pass but it does not continue further. How can I overcome this problem Edit: Error trace added Traceback (most recent call last): File "modify.py", line 22, in <module> for record in reader: File "/usr/lib/python2.6/site-packages/avro-1.7.7-py2.6.egg/avro/datafile.py",