diff --git a/stdlib/2/urllib2.pyi b/stdlib/2/urllib2.pyi index f1005f0229af..f20b183097cf 100644 --- a/stdlib/2/urllib2.pyi +++ b/stdlib/2/urllib2.pyi @@ -12,7 +12,7 @@ class URLError(IOError): class HTTPError(URLError, addinfourl): code = ... # type: int headers = ... # type: Dict[str, str] - def __init__(self, url, code, msg, hdrs, fp) -> None: ... + def __init__(self, url, code, msg, hdrs, fp: addinfourl) -> None: ... class Request(object): host = ... # type: str @@ -49,12 +49,12 @@ class OpenerDirector(object): addheaders: List[Tuple[str, str]] def add_handler(self, handler: BaseHandler) -> None: ... - def open(self, fullurl: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ...): ... + def open(self, fullurl: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ...) -> Optional[addinfourl]: ... def error(self, proto: _string, *args: Any): ... def urlopen(url: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ..., cafile: Optional[_string] = ..., capath: Optional[_string] = ..., cadefault: bool = ..., - context: Optional[ssl.SSLContext] = ...): ... + context: Optional[ssl.SSLContext] = ...) -> Optional[addinfourl]: ... def install_opener(opener: OpenerDirector) -> None: ... def build_opener(*handlers: Union[BaseHandler, Type[BaseHandler]]) -> OpenerDirector: ... @@ -70,16 +70,16 @@ class HTTPErrorProcessor(BaseHandler): def http_response(self, request, response): ... class HTTPDefaultErrorHandler(BaseHandler): - def http_error_default(self, req: Request, fp, code, msg, hdrs): ... + def http_error_default(self, req: Request, fp: addinfourl, code, msg, hdrs): ... class HTTPRedirectHandler(BaseHandler): max_repeats = ... # type: int max_redirections = ... # type: int - def redirect_request(self, req: Request, fp, code, msg, headers, newurl): ... - def http_error_301(self, req: Request, fp, code, msg, headers): ... - def http_error_302(self, req: Request, fp, code, msg, headers): ... - def http_error_303(self, req: Request, fp, code, msg, headers): ... - def http_error_307(self, req: Request, fp, code, msg, headers): ... + def redirect_request(self, req: Request, fp: addinfourl, code, msg, headers, newurl): ... + def http_error_301(self, req: Request, fp: addinfourl, code, msg, headers): ... + def http_error_302(self, req: Request, fp: addinfourl, code, msg, headers): ... + def http_error_303(self, req: Request, fp: addinfourl, code, msg, headers): ... + def http_error_307(self, req: Request, fp: addinfourl, code, msg, headers): ... inf_msg = ... # type: str @@ -106,11 +106,11 @@ class AbstractBasicAuthHandler: class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): auth_header = ... # type: str - def http_error_401(self, req: Request, fp, code, msg, headers): ... + def http_error_401(self, req: Request, fp: addinfourl, code, msg, headers): ... class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): auth_header = ... # type: str - def http_error_407(self, req: Request, fp, code, msg, headers): ... + def http_error_407(self, req: Request, fp: addinfourl, code, msg, headers): ... class AbstractDigestAuthHandler: def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... @@ -127,12 +127,12 @@ class AbstractDigestAuthHandler: class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): auth_header = ... # type: str handler_order = ... # type: int - def http_error_401(self, req: Request, fp, code, msg, headers): ... + def http_error_401(self, req: Request, fp: addinfourl, code, msg, headers): ... class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): auth_header = ... # type: str handler_order = ... # type: int - def http_error_407(self, req: Request, fp, code, msg, headers): ... + def http_error_407(self, req: Request, fp: addinfourl, code, msg, headers): ... class AbstractHTTPHandler(BaseHandler): # undocumented def __init__(self, debuglevel: int = ...) -> None: ...