Skip to content

Commit 74be917

Browse files
Fix stdlib stubtest for latest Python patch releases (#14220)
1 parent 5a619a5 commit 74be917

17 files changed

+211
-44
lines changed

stdlib/@tests/stubtest_allowlists/py310.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,19 @@ _pickle.Pickler.persistent_id
331331
_pickle.Unpickler.persistent_load
332332
pickle.Pickler.persistent_id
333333
pickle.Unpickler.persistent_load
334+
335+
# Incompatible changes introduced in Python 3.10.18
336+
# (Remove once 3.10.18 becomes available for all platforms)
337+
(genericpath.__all__)?
338+
(genericpath.ALLOW_MISSING)?
339+
(ntpath.__all__)?
340+
(ntpath.ALLOW_MISSING)?
341+
(os.path.__all__)?
342+
(os.path.ALLOW_MISSING)?
343+
(os.path.realpath)?
344+
(posixpath.__all__)?
345+
(posixpath.ALLOW_MISSING)?
346+
(posixpath.realpath)?
347+
(tarfile.LinkFallbackError)?
348+
(tarfile.TarFile._extract_member)?
349+
(tarfile.TarFile.makelink_with_filter)?

stdlib/@tests/stubtest_allowlists/py311.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,19 @@ _pickle.Pickler.persistent_id
291291
_pickle.Unpickler.persistent_load
292292
pickle.Pickler.persistent_id
293293
pickle.Unpickler.persistent_load
294+
295+
# Incompatible changes introduced in Python 3.11.13
296+
# (Remove once 3.11.13 becomes available for all platforms)
297+
(genericpath.__all__)?
298+
(genericpath.ALLOW_MISSING)?
299+
(ntpath.__all__)?
300+
(ntpath.ALLOW_MISSING)?
301+
(os.path.__all__)?
302+
(os.path.ALLOW_MISSING)?
303+
(os.path.realpath)?
304+
(posixpath.__all__)?
305+
(posixpath.ALLOW_MISSING)?
306+
(posixpath.realpath)?
307+
(tarfile.LinkFallbackError)?
308+
(tarfile.TarFile._extract_member)?
309+
(tarfile.TarFile.makelink_with_filter)?

stdlib/@tests/stubtest_allowlists/py312.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,19 @@ _pickle.Pickler.persistent_id
264264
_pickle.Unpickler.persistent_load
265265
pickle.Pickler.persistent_id
266266
pickle.Unpickler.persistent_load
267+
268+
# Incompatible changes introduced in Python 3.12.11
269+
# (Remove once 3.12.11 becomes available for all platforms)
270+
(genericpath.__all__)?
271+
(genericpath.ALLOW_MISSING)?
272+
(ntpath.__all__)?
273+
(ntpath.ALLOW_MISSING)?
274+
(os.path.__all__)?
275+
(os.path.ALLOW_MISSING)?
276+
(os.path.realpath)?
277+
(posixpath.__all__)?
278+
(posixpath.ALLOW_MISSING)?
279+
(posixpath.realpath)?
280+
(tarfile.LinkFallbackError)?
281+
(tarfile.TarFile._extract_member)?
282+
(tarfile.TarFile.makelink_with_filter)?

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,32 @@ builtins.property.__set_name__ # Doesn't actually exist
215215
collections\.UserList\.index # ignoring pos-or-keyword parameter
216216
dataclasses.KW_ONLY # white lies around defaults
217217
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
218+
219+
# Changes from patch releases to be introduced in Python 3.14.0b3
220+
# (Remove once 3.14.0b3 becomes available for all platforms)
221+
(genericpath.__all__)?
222+
(genericpath.ALLOW_MISSING)?
223+
(ntpath.__all__)?
224+
(ntpath.ALLOW_MISSING)?
225+
(os.path.__all__)?
226+
(os.path.ALLOW_MISSING)?
227+
(os.path.realpath)?
228+
(posixpath.__all__)?
229+
(posixpath.ALLOW_MISSING)?
230+
(tarfile.__all__)?
231+
(tarfile.LinkFallbackError)?
232+
(tarfile.TarFile._extract_member)?
233+
(tarfile.TarFile.makelink_with_filter)?
234+
(_?hashlib.new)?
235+
(_?hashlib.(openssl_)?md5)?
236+
(_?hashlib.(openssl_)?sha1)?
237+
(_?hashlib.(openssl_)?sha224)?
238+
(_?hashlib.(openssl_)?sha256)?
239+
(_?hashlib.(openssl_)?sha384)?
240+
(_?hashlib.(openssl_)?sha3_224)?
241+
(_?hashlib.(openssl_)?sha3_256)?
242+
(_?hashlib.(openssl_)?sha3_384)?
243+
(_?hashlib.(openssl_)?sha3_512)?
244+
(_?hashlib.(openssl_)?sha512)?
245+
(_?hashlib.(openssl_)?shake_128)?
246+
(_?hashlib.(openssl_)?shake_256)?

stdlib/@tests/stubtest_allowlists/py39.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,20 @@ _pickle.Pickler.persistent_id
281281
_pickle.Unpickler.persistent_load
282282
pickle.Pickler.persistent_id
283283
pickle.Unpickler.persistent_load
284+
285+
# Incompatible changes introduced in Python 3.9.23
286+
# (Remove once 3.9.23 becomes available for all platforms)
287+
(email._header_value_parser.make_quoted_pairs)?
288+
(genericpath.__all__)?
289+
(genericpath.ALLOW_MISSING)?
290+
(ntpath.__all__)?
291+
(ntpath.ALLOW_MISSING)?
292+
(os.path.__all__)?
293+
(os.path.ALLOW_MISSING)?
294+
(os.path.realpath)?
295+
(posixpath.__all__)?
296+
(posixpath.ALLOW_MISSING)?
297+
(posixpath.realpath)?
298+
(tarfile.LinkFallbackError)?
299+
(tarfile.TarFile._extract_member)?
300+
(tarfile.TarFile.makelink_with_filter)?

stdlib/@tests/stubtest_allowlists/win32-py310.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ crypt
5353
nis
5454
ossaudiodev
5555
spwd
56+
57+
# Incompatible changes introduced in Python 3.10.18
58+
# (Remove once 3.10.18 becomes available for Windows)
59+
(ntpath.realpath)?

stdlib/@tests/stubtest_allowlists/win32-py311.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ crypt
2020
nis
2121
ossaudiodev
2222
spwd
23+
24+
# Incompatible changes introduced in Python 3.11.13
25+
# (Remove once 3.11.18 becomes available for Windows)
26+
(ntpath.realpath)?

stdlib/@tests/stubtest_allowlists/win32-py312.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ crypt
2525
nis
2626
ossaudiodev
2727
spwd
28+
29+
# Incompatible changes introduced in Python 3.12.11
30+
# (Remove once 3.12.11 becomes available for Windows)
31+
(ntpath.realpath)?

stdlib/@tests/stubtest_allowlists/win32-py39.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ crypt
6262
nis
6363
ossaudiodev
6464
spwd
65+
66+
# Incompatible changes introduced in Python 3.9.23
67+
# (Remove once 3.9.23 becomes available for Windows)
68+
(ntpath.realpath)?

stdlib/_hashlib.pyi

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,63 @@ def compare_digest(a: ReadableBuffer, b: ReadableBuffer, /) -> bool: ...
6060
def compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ...
6161
def get_fips_mode() -> int: ...
6262
def hmac_new(key: bytes | bytearray, msg: ReadableBuffer = b"", digestmod: _DigestMod = None) -> HMAC: ...
63-
def new(name: str, string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
64-
def openssl_md5(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
65-
def openssl_sha1(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
66-
def openssl_sha224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
67-
def openssl_sha256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
68-
def openssl_sha384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
69-
def openssl_sha512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
70-
def openssl_sha3_224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
71-
def openssl_sha3_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
72-
def openssl_sha3_384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
73-
def openssl_sha3_512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
74-
def openssl_shake_128(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...
75-
def openssl_shake_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...
63+
64+
if sys.version_info >= (3, 13):
65+
def new(
66+
name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
67+
) -> HASH: ...
68+
def openssl_md5(
69+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
70+
) -> HASH: ...
71+
def openssl_sha1(
72+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
73+
) -> HASH: ...
74+
def openssl_sha224(
75+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
76+
) -> HASH: ...
77+
def openssl_sha256(
78+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
79+
) -> HASH: ...
80+
def openssl_sha384(
81+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
82+
) -> HASH: ...
83+
def openssl_sha512(
84+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
85+
) -> HASH: ...
86+
def openssl_sha3_224(
87+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
88+
) -> HASH: ...
89+
def openssl_sha3_256(
90+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
91+
) -> HASH: ...
92+
def openssl_sha3_384(
93+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
94+
) -> HASH: ...
95+
def openssl_sha3_512(
96+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
97+
) -> HASH: ...
98+
def openssl_shake_128(
99+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
100+
) -> HASHXOF: ...
101+
def openssl_shake_256(
102+
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
103+
) -> HASHXOF: ...
104+
105+
else:
106+
def new(name: str, string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
107+
def openssl_md5(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
108+
def openssl_sha1(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
109+
def openssl_sha224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
110+
def openssl_sha256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
111+
def openssl_sha384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
112+
def openssl_sha512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
113+
def openssl_sha3_224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
114+
def openssl_sha3_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
115+
def openssl_sha3_384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
116+
def openssl_sha3_512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
117+
def openssl_shake_128(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...
118+
def openssl_shake_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...
119+
76120
def hmac_digest(key: bytes | bytearray, msg: ReadableBuffer, digest: str) -> bytes: ...
77121
def pbkdf2_hmac(
78122
hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: int | None = None

stdlib/_socket.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ if sys.platform != "win32":
229229
IP_RECVOPTS: int
230230
IP_RECVRETOPTS: int
231231
IP_RETOPTS: int
232+
if sys.version_info >= (3, 13) and sys.platform == "linux":
233+
CAN_RAW_ERR_FILTER: int
232234
if sys.version_info >= (3, 14):
233235
IP_RECVTTL: int
234236

@@ -246,7 +248,6 @@ if sys.version_info >= (3, 14):
246248
TCP_QUICKACK: int
247249

248250
if sys.platform == "linux":
249-
CAN_RAW_ERR_FILTER: int
250251
IP_FREEBIND: int
251252
IP_RECVORIGDSTADDR: int
252253
VMADDR_CID_LOCAL: int

stdlib/email/_header_value_parser.pyi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from collections.abc import Iterable, Iterator
32
from email.errors import HeaderParseError, MessageDefect
43
from email.policy import Policy
@@ -22,10 +21,8 @@ NLSET: Final[set[str]]
2221
# Added in Python 3.9.20, 3.10.15, 3.11.10, 3.12.5
2322
SPECIALSNL: Final[set[str]]
2423

25-
if sys.version_info >= (3, 10):
26-
# Added in Python 3.10.17, 3.11.12, 3.12.9, 3.13.2 (may still be backported to 3.9)
27-
def make_quoted_pairs(value: Any) -> str: ...
28-
24+
# Added in Python 3.9.23, 3.10.17, 3.11.12, 3.12.9, 3.13.2
25+
def make_quoted_pairs(value: Any) -> str: ...
2926
def quote_string(value: Any) -> str: ...
3027

3128
rfc2047_matcher: Pattern[str]

stdlib/genericpath.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import os
22
import sys
33
from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRichComparisonT
44
from collections.abc import Sequence
5-
from typing import Literal, overload
5+
from typing import Literal, NewType, overload
66
from typing_extensions import LiteralString
77

88
__all__ = [
@@ -17,6 +17,7 @@ __all__ = [
1717
"samefile",
1818
"sameopenfile",
1919
"samestat",
20+
"ALLOW_MISSING",
2021
]
2122
if sys.version_info >= (3, 12):
2223
__all__ += ["islink"]
@@ -57,3 +58,7 @@ if sys.version_info >= (3, 13):
5758
def isjunction(path: StrOrBytesPath) -> bool: ...
5859
def isdevdrive(path: StrOrBytesPath) -> bool: ...
5960
def lexists(path: StrOrBytesPath) -> bool: ...
61+
62+
# Added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4
63+
_AllowMissingType = NewType("_AllowMissingType", object)
64+
ALLOW_MISSING: _AllowMissingType

stdlib/ntpath.pyi

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import sys
22
from _typeshed import BytesPath, StrOrBytesPath, StrPath
33
from genericpath import (
4+
ALLOW_MISSING as ALLOW_MISSING,
5+
_AllowMissingType,
46
commonprefix as commonprefix,
57
exists as exists,
68
getatime as getatime,
@@ -89,6 +91,7 @@ __all__ = [
8991
"sameopenfile",
9092
"samestat",
9193
"commonpath",
94+
"ALLOW_MISSING",
9295
]
9396
if sys.version_info >= (3, 12):
9497
__all__ += ["isjunction", "splitroot"]
@@ -108,16 +111,10 @@ def join(path: StrPath, /, *paths: StrPath) -> str: ...
108111
def join(path: BytesPath, /, *paths: BytesPath) -> bytes: ...
109112

110113
if sys.platform == "win32":
111-
if sys.version_info >= (3, 10):
112-
@overload
113-
def realpath(path: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ...
114-
@overload
115-
def realpath(path: AnyStr, *, strict: bool = False) -> AnyStr: ...
116-
else:
117-
@overload
118-
def realpath(path: PathLike[AnyStr]) -> AnyStr: ...
119-
@overload
120-
def realpath(path: AnyStr) -> AnyStr: ...
114+
@overload
115+
def realpath(path: PathLike[AnyStr], *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
116+
@overload
117+
def realpath(path: AnyStr, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
121118

122119
else:
123120
realpath = abspath

stdlib/posixpath.pyi

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import sys
22
from _typeshed import AnyOrLiteralStr, BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath
33
from collections.abc import Iterable
44
from genericpath import (
5+
ALLOW_MISSING as ALLOW_MISSING,
6+
_AllowMissingType,
57
commonprefix as commonprefix,
68
exists as exists,
79
getatime as getatime,
@@ -61,6 +63,7 @@ __all__ = [
6163
"relpath",
6264
"commonpath",
6365
]
66+
__all__ += ["ALLOW_MISSING"]
6467
if sys.version_info >= (3, 12):
6568
__all__ += ["isjunction", "splitroot"]
6669
if sys.version_info >= (3, 13):
@@ -122,19 +125,10 @@ def join(a: LiteralString, /, *paths: LiteralString) -> LiteralString: ...
122125
def join(a: StrPath, /, *paths: StrPath) -> str: ...
123126
@overload
124127
def join(a: BytesPath, /, *paths: BytesPath) -> bytes: ...
125-
126-
if sys.version_info >= (3, 10):
127-
@overload
128-
def realpath(filename: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ...
129-
@overload
130-
def realpath(filename: AnyStr, *, strict: bool = False) -> AnyStr: ...
131-
132-
else:
133-
@overload
134-
def realpath(filename: PathLike[AnyStr]) -> AnyStr: ...
135-
@overload
136-
def realpath(filename: AnyStr) -> AnyStr: ...
137-
128+
@overload
129+
def realpath(filename: PathLike[AnyStr], *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
130+
@overload
131+
def realpath(filename: AnyStr, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
138132
@overload
139133
def relpath(path: LiteralString, start: LiteralString | None = None) -> LiteralString: ...
140134
@overload

stdlib/socket.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,10 @@ if sys.platform == "linux":
773773
if sys.version_info < (3, 11):
774774
from _socket import CAN_RAW_ERR_FILTER as CAN_RAW_ERR_FILTER
775775

776+
__all__ += ["CAN_RAW_ERR_FILTER"]
777+
if sys.version_info >= (3, 13):
778+
from _socket import CAN_RAW_ERR_FILTER as CAN_RAW_ERR_FILTER
779+
776780
__all__ += ["CAN_RAW_ERR_FILTER"]
777781

778782
if sys.platform == "linux":

0 commit comments

Comments
 (0)