How to except the unexpected?

Rene Pijlman at
Sat Mar 4 12:32:40 CET 2006

James Stroud:
>Which suggests that "try: except HTTPException:" will be specific enough 
>as a catchall for this module.
>The following, then, should catch everything you mentioned except the 
>socket timeout:

Your conclusion may be (almost) right in this case. I just don't like this
approach. Basically this is reverse engineering the interface from the
source at the time of writing the app. Even if you get it right, it may
fail next week when someone added an exception to a module.

>But it seems to me that working with the internet as you are doing is 
>fraught with peril anyway.

Why? It shouldn't be.

René Pijlman

More information about the Python-list mailing list