diff --git a/stdlib/2/urllib2.pyi b/stdlib/2/urllib2.pyi index 728d29893..3e99ac5bd 100644 --- a/stdlib/2/urllib2.pyi +++ b/stdlib/2/urllib2.pyi @@ -1,6 +1,7 @@ -from typing import AnyStr, Dict, List, Union +from typing import AnyStr, Dict, List, Union, Optional, Mapping, Callable, Tuple from urllib import addinfourl +from httplib import HTTPResponse class URLError(IOError): reason = ... # type: Union[str, BaseException] @@ -99,14 +100,15 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): def http_error_407(self, req, fp, code, msg, headers): ... class AbstractDigestAuthHandler: - def __init__(self, passwd=None): ... - def reset_retry_count(self): ... - def http_error_auth_reqed(self, auth_header, host, req, headers): ... - def retry_http_digest_auth(self, req, auth): ... - def get_cnonce(self, nonce): ... - def get_authorization(self, req, chal): ... - def get_algorithm_impls(self, algorithm): ... - def get_entity_digest(self, data, chal): ... + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def reset_retry_count(self) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[HTTPResponse]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): auth_header = ... # str diff --git a/stdlib/3/urllib/request.pyi b/stdlib/3/urllib/request.pyi index 0d8c2763b..3624371a6 100644 --- a/stdlib/3/urllib/request.pyi +++ b/stdlib/3/urllib/request.pyi @@ -139,10 +139,15 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... class AbstractDigestAuthHandler: - def __init__(self, - password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def reset_retry_count(self) -> None: ... def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[_UrlopenRet]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int,