urllib.urlopen-bug?

Max M. Stalnaker stalnaker at acm.org
Thu Nov 25 23:31:14 CET 1999


I think you get html on a 404, so it is not really a *server* error.  But
consider:

errcode, errmsg, headers = h.getreply()
  if errcode!=200:
   return

"Markus Krutz" <krutz at cg.tuwien.ac.at> wrote in message
news:943390670.1482784211 at news.teleweb.at...
> Hi,
> I've got a problem using the urlopen-function from the urllib.
> According to the library reference, an IOError-exception should be raised
on
> two conditions:
> 1) The connection can't be made.
> 2) The server returns an error.
> On 1) an exceptions is raised, but if I do a
> urllib.urlopen("http://www.python.org/nonexistingdocument.html")
> no exception is raised, although I think this is a typical 404-Error.
> In my opinion this should result in raising an exception...
> Any hints on other ways how to check for the existence of a net resource?
> (I'm using python v1.5.2)
>
> greetings
> Markus
>






More information about the Python-list mailing list