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 wa
You need the try/except inside the loop:
for i in reader:
try:
print i
except UnicodeEncodeError:
pass
By the way it's good practice to specify the specific type of error you're trying to catch (like I did with except UnicodeEncodeError:
, since otherwise you risk making your code very hard to debug!