Why does this fail?
mark at mceahern.com
Mon Jan 5 02:40:23 CET 2004
On Sun, 2004-01-04 at 18:58, Dave Murray wrote:
> New to Python question, why does this fail?
Because you're treating all errors as if they're what you expect. You
should be more specific in your except clause. Do this and you'll see
what I mean:
raise # raise whatever exception occurred
In other words, you should be explicit about the errors you silence.
Also, it's not clear what Checkit() is actually supposed to do. Is it
supposed to verify the URL actually exists? urllib doesn't raise an
error for 404 not found--urllib2 does. Try that instead.
More information about the Python-list