> that tells you the exact code line where the error occurred. No need to
> look around.


You are right:

try:
    for line in f:
       do_something()
except UnicodeDecodeError:
    do_something_different()

does exactly what one would expect it to do. 

Thank you very much for pointing this out and sorry for all the posts. This is 
one of the days when nothing seems to work and when I don't seem to able to 
read the simplest error message. 

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to