Skip to content

Commit 77c70ed

Browse files
committed
reflect the impossibility of passing context and "files" args at once
1 parent d2dca33 commit 77c70ed

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

stdlib/ftplib.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,12 @@ class FTP_TLS(FTP):
127127
user: str = "",
128128
passwd: str = "",
129129
acct: str = "",
130-
*,
130+
keyfile: None = None,
131+
certfile: None = None,
131132
context: SSLContext | None = None,
132133
timeout: float | None = ...,
133134
source_address: tuple[str, int] | None = None,
135+
*,
134136
encoding: str = "utf-8",
135137
) -> None: ...
136138
@overload
@@ -146,7 +148,7 @@ class FTP_TLS(FTP):
146148
acct: str = "",
147149
keyfile: StrOrBytesPath | None = None,
148150
certfile: StrOrBytesPath | None = None,
149-
context: SSLContext | None = None,
151+
context: None = None,
150152
timeout: float | None = ...,
151153
source_address: tuple[str, int] | None = None,
152154
*,

stdlib/http/client.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,13 @@ class HTTPSConnection(HTTPConnection):
228228
self,
229229
host: str,
230230
port: int | None = None,
231-
*,
231+
key_file: None = None,
232+
cert_file: None = None,
232233
timeout: float | None = ...,
233234
source_address: tuple[str, int] | None = None,
235+
*,
234236
context: ssl.SSLContext | None = None,
237+
check_hostname: None = None,
235238
blocksize: int = 8192,
236239
) -> None: ...
237240
@overload

stdlib/imaplib.pyi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ class IMAP4_SSL(IMAP4):
127127
else:
128128
@overload
129129
def __init__(
130-
self, host: str = "", port: int = 993, *, ssl_context: SSLContext | None = None, timeout: float | None = None
130+
self,
131+
host: str = "",
132+
port: int = 993,
133+
keyfile: None = None,
134+
certfile: None = None,
135+
ssl_context: SSLContext | None = None,
136+
timeout: float | None = None,
131137
) -> None: ...
132138
@overload
133139
@deprecated(
@@ -140,7 +146,7 @@ class IMAP4_SSL(IMAP4):
140146
port: int = 993,
141147
keyfile: StrOrBytesPath | None = None,
142148
certfile: StrOrBytesPath | None = None,
143-
ssl_context: SSLContext | None = None,
149+
ssl_context: None = None,
144150
timeout: float | None = None,
145151
) -> None: ...
146152
keyfile: StrOrBytesPath | None

stdlib/poplib.pyi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ class POP3_SSL(POP3):
6161
else:
6262
@overload
6363
def __init__(
64-
self, host: str, port: int = 995, *, timeout: float = ..., context: ssl.SSLContext | None = None
64+
self,
65+
host: str,
66+
port: int = 995,
67+
keyfile: None = None,
68+
certfile: None = None,
69+
timeout: float = ...,
70+
context: ssl.SSLContext | None = None,
6571
) -> None: ...
6672
@overload
6773
@deprecated(
@@ -75,7 +81,7 @@ class POP3_SSL(POP3):
7581
keyfile: StrOrBytesPath | None = None,
7682
certfile: StrOrBytesPath | None = None,
7783
timeout: float = ...,
78-
context: ssl.SSLContext | None = None,
84+
context: None = None,
7985
) -> None: ...
8086
keyfile: StrOrBytesPath | None
8187
certfile: StrOrBytesPath | None

stdlib/smtplib.pyi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ class SMTP:
132132
def starttls(self, *, context: SSLContext | None = None) -> _Reply: ...
133133
else:
134134
@overload
135-
def starttls(self, *, context: SSLContext | None = None) -> _Reply: ...
135+
def starttls(self, keyfile: None = None, certfile: None = None, context: SSLContext | None = None) -> _Reply: ...
136136
@overload
137137
@deprecated(
138138
"The `keyfile`, `certfile` parameters are deprecated since Python 3.6; "
139139
"removed in Python 3.12. Use `context` parameter instead."
140140
)
141141
def starttls(
142-
self, keyfile: StrOrBytesPath | None = None, certfile: StrOrBytesPath | None = None, context: SSLContext | None = None
142+
self, keyfile: StrOrBytesPath | None = None, certfile: StrOrBytesPath | None = None, context: None = None
143143
) -> _Reply: ...
144144

145145
def sendmail(
@@ -181,7 +181,8 @@ class SMTP_SSL(SMTP):
181181
host: str = "",
182182
port: int = 0,
183183
local_hostname: str | None = None,
184-
*,
184+
keyfile: None = None,
185+
certfile: None = None,
185186
timeout: float = ...,
186187
source_address: _SourceAddress | None = None,
187188
context: SSLContext | None = None,
@@ -200,7 +201,7 @@ class SMTP_SSL(SMTP):
200201
certfile: StrOrBytesPath | None = None,
201202
timeout: float = ...,
202203
source_address: _SourceAddress | None = None,
203-
context: SSLContext | None = None,
204+
context: None = None,
204205
) -> None: ...
205206
keyfile: StrOrBytesPath | None
206207
certfile: StrOrBytesPath | None

0 commit comments

Comments
 (0)