mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
urllib: various fixes (#3813)
This commit is contained in:
@@ -109,14 +109,14 @@ else:
|
||||
) -> List[Tuple[AnyStr, AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def quote(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ...
|
||||
def quote(string: str, safe: _Str = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ...
|
||||
@overload
|
||||
def quote(string: bytes, safe: _Str = ...) -> str: ...
|
||||
|
||||
def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ...
|
||||
|
||||
@overload
|
||||
def quote_plus(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ...
|
||||
def quote_plus(string: str, safe: _Str = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ...
|
||||
@overload
|
||||
def quote_plus(string: bytes, safe: _Str = ...) -> str: ...
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ def install_opener(opener: OpenerDirector) -> None: ...
|
||||
def build_opener(
|
||||
*handlers: Union[BaseHandler, Callable[[], BaseHandler]]
|
||||
) -> OpenerDirector: ...
|
||||
def url2pathname(path: str) -> str: ...
|
||||
def pathname2url(path: str) -> str: ...
|
||||
def url2pathname(pathname: str) -> str: ...
|
||||
def pathname2url(pathname: str) -> str: ...
|
||||
def getproxies() -> Dict[str, str]: ...
|
||||
def parse_http_list(s: str) -> List[str]: ...
|
||||
def parse_keqv_list(l: List[str]) -> Dict[str, str]: ...
|
||||
@@ -66,7 +66,7 @@ class Request:
|
||||
class OpenerDirector:
|
||||
addheaders: List[Tuple[str, str]]
|
||||
def add_handler(self, handler: BaseHandler) -> None: ...
|
||||
def open(self, url: Union[str, Request], data: Optional[bytes] = ...,
|
||||
def open(self, fullurl: Union[str, Request], data: Optional[bytes] = ...,
|
||||
timeout: Optional[float] = ...) -> _UrlopenRet: ...
|
||||
def error(self, proto: str, *args: Any) -> _UrlopenRet: ...
|
||||
|
||||
@@ -77,22 +77,22 @@ class BaseHandler:
|
||||
def add_parent(self, parent: OpenerDirector) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> _UrlopenRet: ...
|
||||
headers: Mapping[str, str]) -> _UrlopenRet: ...
|
||||
|
||||
class HTTPDefaultErrorHandler(BaseHandler): ...
|
||||
|
||||
class HTTPRedirectHandler(BaseHandler):
|
||||
def redirect_request(self, req: Request, fp: IO[str], code: int, msg: str,
|
||||
hdrs: Mapping[str, str],
|
||||
headers: Mapping[str, str],
|
||||
newurl: str) -> Optional[Request]: ...
|
||||
def http_error_301(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
def http_error_302(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
def http_error_303(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
def http_error_307(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
|
||||
class HTTPCookieProcessor(BaseHandler):
|
||||
cookiejar: CookieJar
|
||||
@@ -132,11 +132,11 @@ class AbstractBasicAuthHandler:
|
||||
|
||||
class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):
|
||||
def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
|
||||
class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):
|
||||
def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
|
||||
class AbstractDigestAuthHandler:
|
||||
def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ...
|
||||
@@ -151,11 +151,11 @@ class AbstractDigestAuthHandler:
|
||||
|
||||
class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
|
||||
def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
|
||||
class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
|
||||
def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int,
|
||||
hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
headers: Mapping[str, str]) -> Optional[_UrlopenRet]: ...
|
||||
|
||||
class AbstractHTTPHandler(BaseHandler): # undocumented
|
||||
def __init__(self, debuglevel: int = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user