例外與警告¶
- exception urllib3.exceptions.BodyNotHttplibCompatible¶
基底類別:
HTTPErrorBody should be
http.client.HTTPResponselike (have an fp attribute which returns raw chunks) for read_chunked().
- exception urllib3.exceptions.ClosedPoolError(pool, message)¶
基底類別:
PoolErrorRaised when a request enters a pool after the pool has been closed.
- 參數:
pool (ConnectionPool)
message (str)
- 回傳型別:
None
- exception urllib3.exceptions.ConnectTimeoutError¶
基底類別:
TimeoutErrorRaised when a socket timeout occurs while connecting to a server
- urllib3.exceptions.ConnectionError¶
Renamed to ProtocolError but aliased for backwards compatibility.
- exception urllib3.exceptions.DependencyWarning¶
基底類別:
HTTPWarningWarned when an attempt is made to import a module with missing optional dependencies.
- exception urllib3.exceptions.EmptyPoolError(pool, message)¶
基底類別:
PoolErrorRaised when a pool runs out of connections and no more are allowed.
- 參數:
pool (ConnectionPool)
message (str)
- 回傳型別:
None
- exception urllib3.exceptions.FullPoolError(pool, message)¶
基底類別:
PoolErrorRaised when we try to add a connection to a full pool in blocking mode.
- 參數:
pool (ConnectionPool)
message (str)
- 回傳型別:
None
- exception urllib3.exceptions.HeaderParsingError(defects, unparsed_data)¶
基底類別:
HTTPErrorRaised by assert_header_parsing, but we convert it to a log.warning statement.
- exception urllib3.exceptions.HostChangedError(pool, url, retries=3)¶
基底類別:
RequestErrorRaised when an existing pool gets a request for a foreign host.
- 參數:
pool (ConnectionPool)
url (str)
- 回傳型別:
None
- exception urllib3.exceptions.IncompleteRead(partial, expected)¶
基底類別:
HTTPError,IncompleteReadResponse length doesn't match expected Content-Length
Subclass of
http.client.IncompleteReadto allow int value forpartialto avoid creating large objects on streamed reads.
- exception urllib3.exceptions.InsecurePlatformWarning¶
基底類別:
SecurityWarningWarned when certain TLS/SSL configuration is not available on a platform.
- exception urllib3.exceptions.InsecureRequestWarning¶
基底類別:
SecurityWarningWarned when making an unverified HTTPS request.
- exception urllib3.exceptions.InvalidChunkLength(response, length)¶
基底類別:
HTTPError,IncompleteReadInvalid chunk length in a chunked response.
- 參數:
response (HTTPResponse)
length (bytes)
- 回傳型別:
None
- exception urllib3.exceptions.LocationParseError(location)¶
基底類別:
LocationValueErrorRaised when get_host or similar fails to parse the URL input.
- 參數:
location (str)
- 回傳型別:
None
- exception urllib3.exceptions.LocationValueError¶
基底類別:
ValueError,HTTPErrorRaised when there is something wrong with a given URL input.
- exception urllib3.exceptions.MaxRetryError(pool, url, reason=None)¶
基底類別:
RequestErrorRaised when the maximum number of retries is exceeded.
- 參數:
pool (
HTTPConnectionPool) -- 連接池url (str) -- The requested Url
reason (
Exception) -- The underlying error
- 回傳型別:
None
- exception urllib3.exceptions.NameResolutionError(host, conn, reason)¶
基底類別:
NewConnectionError當主機名稱解析失敗時引發。
- 參數:
host (str)
conn (HTTPConnection)
reason (socket.gaierror)
- exception urllib3.exceptions.NewConnectionError(conn, message)¶
基底類別:
ConnectTimeoutError,HTTPErrorRaised when we fail to establish a new connection. Usually ECONNREFUSED.
- 參數:
conn (HTTPConnection)
message (str)
- 回傳型別:
None
- property pool: HTTPConnection¶
- exception urllib3.exceptions.NotOpenSSLWarning¶
基底類別:
SecurityWarningWarned when using unsupported SSL library
- exception urllib3.exceptions.PoolError(pool, message)¶
基底類別:
HTTPErrorBase exception for errors caused within a pool.
- 參數:
pool (ConnectionPool)
message (str)
- 回傳型別:
None
- exception urllib3.exceptions.ProtocolError¶
基底類別:
HTTPErrorRaised when something unexpected happens mid-request/response.
- exception urllib3.exceptions.ProxyError(message, error)¶
基底類別:
HTTPErrorRaised when the connection to a proxy fails.
- exception urllib3.exceptions.ProxySchemeUnknown(scheme)¶
基底類別:
AssertionError,URLSchemeUnknownProxyManager does not support the supplied scheme
- 參數:
scheme (str | None)
- 回傳型別:
None
- exception urllib3.exceptions.ProxySchemeUnsupported¶
基底類別:
ValueErrorFetching HTTPS resources through HTTPS proxies is unsupported
- exception urllib3.exceptions.ReadTimeoutError(pool, url, message)¶
基底類別:
TimeoutError,RequestErrorRaised when a socket timeout occurs while receiving data from a server
- 參數:
pool (ConnectionPool)
url (str | None)
message (str)
- 回傳型別:
None
- exception urllib3.exceptions.RequestError(pool, url, message)¶
基底類別:
PoolErrorBase exception for PoolErrors that have associated URLs.
- 參數:
pool (ConnectionPool)
url (str | None)
message (str)
- 回傳型別:
None
- exception urllib3.exceptions.ResponseError¶
基底類別:
HTTPErrorUsed as a container for an error reason supplied in a MaxRetryError.
- GENERIC_ERROR = 'too many error responses'¶
- SPECIFIC_ERROR = 'too many {status_code} error responses'¶
- exception urllib3.exceptions.ResponseNotChunked¶
基底類別:
ProtocolError,ValueErrorResponse needs to be chunked in order to read it as chunks.
- exception urllib3.exceptions.SSLError¶
基底類別:
HTTPErrorRaised when SSL certificate fails in an HTTPS connection.
- exception urllib3.exceptions.SecurityWarning¶
基底類別:
HTTPWarningWarned when performing security reducing actions
- exception urllib3.exceptions.SystemTimeWarning¶
基底類別:
SecurityWarningWarned when system time is suspected to be wrong
- exception urllib3.exceptions.TimeoutError¶
基底類別:
HTTPErrorRaised when a socket timeout error occurs.
Catching this error will catch both
ReadTimeoutErrorsandConnectTimeoutErrors.
- exception urllib3.exceptions.TimeoutStateError¶
基底類別:
HTTPErrorRaised when passing an invalid state to a timeout
- exception urllib3.exceptions.URLSchemeUnknown(scheme)¶
基底類別:
LocationValueErrorRaised when a URL input has an unsupported scheme.
- 參數:
scheme (str)