From 01ccf25d62ee10ad48e1b3d8e82d638b4430fa64 Mon Sep 17 00:00:00 2001 From: Mahmoud Harmouch Date: Sun, 9 May 2021 11:18:24 +0300 Subject: [PATCH] Add missing members for AbstractBasicAuthHandler class (#5379) * Add missing members for AbstractBasicAuthHandler class Signed-off-by: Harmouch101 * Added missing functions to ftpwrapper Signed-off-by: Harmouch101 --- stdlib/urllib/request.pyi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/stdlib/urllib/request.pyi b/stdlib/urllib/request.pyi index 7ead36e90..ba7fe8cc3 100644 --- a/stdlib/urllib/request.pyi +++ b/stdlib/urllib/request.pyi @@ -21,7 +21,7 @@ from typing import ( overload, ) from urllib.error import HTTPError -from urllib.response import addinfourl +from urllib.response import addclosehook, addinfourl _T = TypeVar("_T") _UrlopenRet = Any @@ -155,6 +155,8 @@ class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm): class AbstractBasicAuthHandler: rx: ClassVar[Pattern[str]] # undocumented + passwd: HTTPPasswordMgr + add_password: Callable[[str, Union[str, Sequence[str]], str, str], None] def __init__(self, password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... def http_error_auth_reqed(self, authreq: str, host: str, req: Request, headers: Mapping[str, str]) -> None: ... def http_request(self, req: Request) -> Request: ... # undocumented @@ -227,6 +229,12 @@ class ftpwrapper: # undocumented def __init__( self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: Optional[float] = ..., persistent: bool = ... ) -> None: ... + def close(self) -> None: ... + def endtransfer(self) -> None: ... + def file_close(self) -> None: ... + def init(self) -> None: ... + def real_close(self) -> None: ... + def retrfile(self, file: str, type: str) -> Tuple[addclosehook, int]: ... class FTPHandler(BaseHandler): def ftp_open(self, req: Request) -> addinfourl: ...