mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 13:40:23 +08:00
[stdlib] Deprecate keyfile, certfile and check_hostname parameters (#15259)
This commit is contained in:
+28
-8
@@ -1,11 +1,11 @@
|
||||
import sys
|
||||
from _typeshed import SupportsRead, SupportsReadline
|
||||
from _typeshed import StrOrBytesPath, SupportsRead, SupportsReadline
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from socket import socket
|
||||
from ssl import SSLContext
|
||||
from types import TracebackType
|
||||
from typing import Any, Final, Literal, TextIO
|
||||
from typing_extensions import Self
|
||||
from typing import Any, Final, Literal, TextIO, overload
|
||||
from typing_extensions import Self, deprecated
|
||||
|
||||
__all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto", "all_errors", "FTP_TLS"]
|
||||
|
||||
@@ -120,23 +120,43 @@ class FTP_TLS(FTP):
|
||||
encoding: str = "utf-8",
|
||||
) -> None: ...
|
||||
else:
|
||||
@overload
|
||||
def __init__(
|
||||
self,
|
||||
host: str = "",
|
||||
user: str = "",
|
||||
passwd: str = "",
|
||||
acct: str = "",
|
||||
keyfile: str | None = None,
|
||||
certfile: str | None = None,
|
||||
keyfile: None = None,
|
||||
certfile: None = None,
|
||||
context: SSLContext | None = None,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = None,
|
||||
*,
|
||||
encoding: str = "utf-8",
|
||||
) -> None: ...
|
||||
ssl_version: int
|
||||
keyfile: str | None
|
||||
certfile: str | None
|
||||
@overload
|
||||
@deprecated(
|
||||
"The `keyfile`, `certfile` parameters are deprecated since Python 3.6; "
|
||||
"removed in Python 3.12. Use `context` parameter instead."
|
||||
)
|
||||
def __init__(
|
||||
self,
|
||||
host: str = "",
|
||||
user: str = "",
|
||||
passwd: str = "",
|
||||
acct: str = "",
|
||||
keyfile: StrOrBytesPath | None = None,
|
||||
certfile: StrOrBytesPath | None = None,
|
||||
context: None = None,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = None,
|
||||
*,
|
||||
encoding: str = "utf-8",
|
||||
) -> None: ...
|
||||
ssl_version: int
|
||||
keyfile: StrOrBytesPath | None
|
||||
certfile: StrOrBytesPath | None
|
||||
context: SSLContext
|
||||
def login(self, user: str = "", passwd: str = "", acct: str = "", secure: bool = True) -> str: ...
|
||||
def auth(self) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user