diff --git a/stdlib/3/urllib/parse.pyi b/stdlib/3/urllib/parse.pyi index 10626ba20..42dfee324 100644 --- a/stdlib/3/urllib/parse.pyi +++ b/stdlib/3/urllib/parse.pyi @@ -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: ... diff --git a/stdlib/3/urllib/request.pyi b/stdlib/3/urllib/request.pyi index 6cddf60f4..6bc9a2327 100644 --- a/stdlib/3/urllib/request.pyi +++ b/stdlib/3/urllib/request.pyi @@ -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: ... diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index 10be133d3..686730531 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -794,22 +794,8 @@ unittest.result.TestResult.addSubTest unittest.runner.TestRunner unittest.signals.removeHandler unittest.suite.TestSuite.run -urllib.parse.quote -urllib.parse.quote_plus urllib.request.BaseHandler.http_error_nnn -urllib.request.HTTPBasicAuthHandler.http_error_401 -urllib.request.HTTPDigestAuthHandler.http_error_401 -urllib.request.HTTPRedirectHandler.http_error_301 -urllib.request.HTTPRedirectHandler.http_error_302 -urllib.request.HTTPRedirectHandler.http_error_303 -urllib.request.HTTPRedirectHandler.http_error_307 -urllib.request.HTTPRedirectHandler.redirect_request -urllib.request.OpenerDirector.open -urllib.request.ProxyBasicAuthHandler.http_error_407 -urllib.request.ProxyDigestAuthHandler.http_error_407 -urllib.request.pathname2url urllib.request.proxy_bypass -urllib.request.url2pathname urllib.response.addbase.__next__ urllib.response.addbase.fileno urllib.response.addbase.flush