urllib.error — 由 urllib.request 引发的异常类

源代码: Lib/urllib/error.py


The urllib.error module defines the exception classes for exceptions raised by urllib.request . The base exception class is URLError .

The following exceptions are raised by urllib.error as appropriate:

exception urllib.error. URLError

The handlers raise this exception (or derived exceptions) when they run into a problem. It is a subclass of OSError .

reason

The reason for this error. It can be a message string or another exception instance.

3.3 版改变: URLError used to be a subtype of IOError ,现在是别名化的 OSError .