Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include exceptions.pyi and fields.pyi
- Loading branch information
Showing
6 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from typing import Any, Optional, Union, Tuple, TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from urllib3.connectionpool import ConnectionPool | ||
|
||
class HTTPError(Exception): ... | ||
class HTTPWarning(Warning): ... | ||
|
||
class PoolError(HTTPError): | ||
pool: ConnectionPool | ||
def __init__(self, pool: ConnectionPool, message: str) -> None: ... | ||
def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... | ||
|
||
class RequestError(PoolError): | ||
url: str | ||
def __init__(self, pool: ConnectionPool, url: str, message: str) -> None: ... | ||
def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... | ||
|
||
class SSLError(HTTPError): ... | ||
class ProxyError(HTTPError): ... | ||
class DecodeError(HTTPError): ... | ||
class ProtocolError(HTTPError): ... | ||
|
||
ConnectionError: ProtocolError | ||
|
||
class MaxRetryError(RequestError): | ||
reason: str | ||
def __init__( | ||
self, pool: ConnectionPool, url: str, reason: Optional[str] | ||
) -> None: ... | ||
|
||
class HostChangedError(RequestError): | ||
retries: int | ||
def __init__(self, pool: ConnectionPool, url: str, retries: int) -> None: ... | ||
|
||
class TimeoutStateError(HTTPError): ... | ||
class TimeoutError(HTTPError): ... | ||
class ReadTimeoutError(TimeoutError, RequestError): ... | ||
class ConnectTimeoutError(TimeoutError): ... | ||
class EmptyPoolError(PoolError): ... | ||
class ClosedPoolError(PoolError): ... | ||
class LocationValueError(ValueError, HTTPError): ... | ||
|
||
class LocationParseError(LocationValueError): | ||
location: str | ||
def __init__(self, location: str) -> None: ... | ||
|
||
class ResponseError(HTTPError): | ||
GENERIC_ERROR: Any | ||
SPECIFIC_ERROR: Any | ||
|
||
class SecurityWarning(HTTPWarning): ... | ||
class InsecureRequestWarning(SecurityWarning): ... | ||
class SystemTimeWarning(SecurityWarning): ... | ||
class InsecurePlatformWarning(SecurityWarning): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Stubs for requests.packages.urllib3.fields (Python 3.4) | ||
|
||
from typing import Any, Callable, Mapping, Optional | ||
|
||
def guess_content_type(filename: str, default: str) -> str: ... | ||
def format_header_param_rfc2231(name: str, value: str) -> str: ... | ||
def format_header_param_html5(name: str, value: str) -> str: ... | ||
def format_header_param(name: str, value: str) -> str: ... | ||
|
||
class RequestField: | ||
data: Any | ||
headers: Optional[Mapping[str, str]] | ||
def __init__( | ||
self, | ||
name: str, | ||
data: Any, | ||
filename: Optional[str], | ||
headers: Optional[Mapping[str, str]], | ||
header_formatter: Callable[[str, str], str], | ||
) -> None: ... | ||
@classmethod | ||
def from_tuples( | ||
cls, fieldname: str, value: str, header_formatter: Callable[[str, str], str] | ||
) -> RequestField: ... | ||
def render_headers(self) -> str: ... | ||
def make_multipart( | ||
self, content_disposition: str, content_type: str, content_location: str | ||
) -> None: ... |
Empty file.
Empty file.
Empty file.