Back to module index
Go to module by name
urllib
urllib.error
Exception classes raised by urllib.
The base exception class is URLError, which inherits from OSError. It
doesn't define any behavior of its own, but is the base class for all
exceptions defined in this package.
HTTPError is an exception class that is also a valid HTTP response
instance. It behaves this way because HTTP protocol errors are valid
responses, with a status code, headers, and a body. In some contexts,
an application may want to handle an exception like a regular
response.
Classes
ContentTooShortError
Exception raised when downloaded size does not match content-length.
with_traceback(...)
Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>
characters_written = <attribute 'characters_written' of 'OSError' objects>
errno = <member 'errno' of 'OSError' objects>
POSIX exception code
filename = <member 'filename' of 'OSError' objects>
exception filename
filename2 = <member 'filename2' of 'OSError' objects>
second exception filename
strerror = <member 'strerror' of 'OSError' objects>
exception strerror
HTTPError
Raised when HTTP error occurs, but also acts like non-error return
close(self)
Close the temporary file, possibly deleting it.
getcode(self)
geturl(self)
info(self)
with_traceback(...)
Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>
characters_written = <attribute 'characters_written' of 'OSError' objects>
errno = <member 'errno' of 'OSError' objects>
POSIX exception code
filename = <member 'filename' of 'OSError' objects>
exception filename
filename2 = <member 'filename2' of 'OSError' objects>
second exception filename
headers = <property object at 0x7f75e0768bd0>
reason = <property object at 0x7f75e0768590>
status = <property object at 0x7f75e0768a90>
strerror = <member 'strerror' of 'OSError' objects>
exception strerror
URLError
with_traceback(...)
Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>
characters_written = <attribute 'characters_written' of 'OSError' objects>
errno = <member 'errno' of 'OSError' objects>
POSIX exception code
filename = <member 'filename' of 'OSError' objects>
exception filename
filename2 = <member 'filename2' of 'OSError' objects>
second exception filename
strerror = <member 'strerror' of 'OSError' objects>
exception strerror
Modules
urllib