From 36efbf89edf1a25f29f8366e44c1fdfa05e948cc Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 8 Jun 2023 00:57:44 -0700 Subject: [PATCH] ftplib: update for py312 (#10282) --- stdlib/ftplib.pyi | 15 ++++++++++++++- tests/stubtest_allowlists/py311.txt | 2 +- tests/stubtest_allowlists/py312.txt | 3 +-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 36a213d48..f24d14fbf 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -118,7 +118,20 @@ class FTP: def close(self) -> None: ... class FTP_TLS(FTP): - if sys.version_info >= (3, 9): + if sys.version_info >= (3, 12): + def __init__( + self, + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", + *, + context: SSLContext | None = None, + timeout: float = ..., + source_address: tuple[str, int] | None = None, + encoding: str = "utf-8", + ) -> None: ... + elif sys.version_info >= (3, 9): def __init__( self, host: str = "", diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index 493b5d261..2c54dae68 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -17,7 +17,6 @@ configparser.LegacyInterpolation.__init__ configparser.ParsingError.filename enum.Enum.__init__ enum.Enum._generate_next_value_ -ftplib.FTP.trust_server_pasv_ipv4_address importlib.abc.Finder.find_module ipaddress._BaseNetwork.broadcast_address ipaddress._BaseNetwork.hostmask @@ -88,6 +87,7 @@ dataclasses.KW_ONLY # white lies around defaults enum.auto.__init__ # The stub for enum.auto is nothing like the implementation enum.auto.value # The stub for enum.auto is nothing like the implementation fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically functools.cached_property.__set__ # Stub is a white lie; see comments in the stub hmac.new # Stub is a white lie; see comments in the stub diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 86606bfa2..32258bef9 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -30,7 +30,6 @@ enum.Enum.__signature__ enum.EnumMeta.__call__ enum.EnumType.__call__ enum.property.member -ftplib.FTP_TLS.__init__ genericpath.__all__ genericpath.islink gzip.GzipFile.filename @@ -224,7 +223,6 @@ _csv.Reader _csv.Writer configparser.LegacyInterpolation.__init__ enum.Enum.__init__ -ftplib.FTP.trust_server_pasv_ipv4_address ipaddress._BaseNetwork.broadcast_address ipaddress._BaseNetwork.hostmask ipaddress.IPv4Interface.hostmask @@ -293,6 +291,7 @@ dataclasses.KW_ONLY # white lies around defaults enum.auto.__init__ # The stub for enum.auto is nothing like the implementation enum.auto.value # The stub for enum.auto is nothing like the implementation fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically functools.cached_property.__set__ # Stub is a white lie; see comments in the stub hmac.new # Stub is a white lie; see comments in the stub