mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Fix small issues in ftplib (#6154)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from _typeshed import Self, SupportsRead, SupportsReadline
|
||||
from socket import socket
|
||||
from ssl import SSLContext
|
||||
@@ -32,20 +33,37 @@ class FTP:
|
||||
lastresp: str
|
||||
file: TextIO | None
|
||||
encoding: str
|
||||
|
||||
# The following variable is intentionally left undocumented.
|
||||
# See https://bugs.python.org/issue43285 for relevant discussion
|
||||
# trust_server_pasv_ipv4_address: bool
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
source_address: Tuple[str, int] | None
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
user: str = ...,
|
||||
passwd: str = ...,
|
||||
acct: str = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Tuple[str, int] | None = ...,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
user: str = ...,
|
||||
passwd: str = ...,
|
||||
acct: str = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Tuple[str, int] | None = ...,
|
||||
*,
|
||||
encoding: str = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
user: str = ...,
|
||||
passwd: str = ...,
|
||||
acct: str = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Tuple[str, int] | None = ...,
|
||||
) -> None: ...
|
||||
def connect(
|
||||
self, host: str = ..., port: int = ..., timeout: float = ..., source_address: Tuple[str, int] | None = ...
|
||||
) -> str: ...
|
||||
@@ -100,18 +118,34 @@ class FTP:
|
||||
def close(self) -> None: ...
|
||||
|
||||
class FTP_TLS(FTP):
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
user: str = ...,
|
||||
passwd: str = ...,
|
||||
acct: str = ...,
|
||||
keyfile: str | None = ...,
|
||||
certfile: str | None = ...,
|
||||
context: SSLContext | None = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Tuple[str, int] | None = ...,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
user: str = ...,
|
||||
passwd: str = ...,
|
||||
acct: str = ...,
|
||||
keyfile: str | None = ...,
|
||||
certfile: str | None = ...,
|
||||
context: SSLContext | None = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Tuple[str, int] | None = ...,
|
||||
*,
|
||||
encoding: str = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
host: str = ...,
|
||||
user: str = ...,
|
||||
passwd: str = ...,
|
||||
acct: str = ...,
|
||||
keyfile: str | None = ...,
|
||||
certfile: str | None = ...,
|
||||
context: SSLContext | None = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Tuple[str, int] | None = ...,
|
||||
) -> None: ...
|
||||
ssl_version: int
|
||||
keyfile: str | None
|
||||
certfile: str | None
|
||||
|
||||
Reference in New Issue
Block a user