newbie question about confusing exception handling in urllib

Peter Otten __peter__ at web.de
Tue Apr 9 10:46:38 EDT 2013


cabbar at gmail.com wrote:

> Ah, looks better.
> 
> But, 2 questions:
> 
> 1. I should also catch ConnectionResetError I am guessing.

Does it need a special reaction? If so give it its own except suite.

> 2. How do I handle all other exceptions, just say Exception: and handle
> them? I want to silently ignore them.

If at all I would do that in the client code. Also, catch Exception rather 
than BaseException.






More information about the Python-list mailing list