Skip to content

Fix stdlib stubtest for latest Python patch releases #14220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,19 @@ _pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load

# Incompatible changes introduced in Python 3.10.18
# (Remove once 3.10.18 becomes available for all platforms)
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
(ntpath.ALLOW_MISSING)?
(os.path.__all__)?
(os.path.ALLOW_MISSING)?
(os.path.realpath)?
(posixpath.__all__)?
(posixpath.ALLOW_MISSING)?
(posixpath.realpath)?
(tarfile.LinkFallbackError)?
(tarfile.TarFile._extract_member)?
(tarfile.TarFile.makelink_with_filter)?
16 changes: 16 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,19 @@ _pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load

# Incompatible changes introduced in Python 3.11.13
# (Remove once 3.11.13 becomes available for all platforms)
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
(ntpath.ALLOW_MISSING)?
(os.path.__all__)?
(os.path.ALLOW_MISSING)?
(os.path.realpath)?
(posixpath.__all__)?
(posixpath.ALLOW_MISSING)?
(posixpath.realpath)?
(tarfile.LinkFallbackError)?
(tarfile.TarFile._extract_member)?
(tarfile.TarFile.makelink_with_filter)?
16 changes: 16 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,19 @@ _pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load

# Incompatible changes introduced in Python 3.12.11
# (Remove once 3.12.11 becomes available for all platforms)
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
(ntpath.ALLOW_MISSING)?
(os.path.__all__)?
(os.path.ALLOW_MISSING)?
(os.path.realpath)?
(posixpath.__all__)?
(posixpath.ALLOW_MISSING)?
(posixpath.realpath)?
(tarfile.LinkFallbackError)?
(tarfile.TarFile._extract_member)?
(tarfile.TarFile.makelink_with_filter)?
29 changes: 29 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py314.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,32 @@ builtins.property.__set_name__ # Doesn't actually exist
collections\.UserList\.index # ignoring pos-or-keyword parameter
dataclasses.KW_ONLY # white lies around defaults
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect

# Changes from patch releases to be introduced in Python 3.14.0b3
# (Remove once 3.14.0b3 becomes available for all platforms)
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
(ntpath.ALLOW_MISSING)?
(os.path.__all__)?
(os.path.ALLOW_MISSING)?
(os.path.realpath)?
(posixpath.__all__)?
(posixpath.ALLOW_MISSING)?
(tarfile.__all__)?
(tarfile.LinkFallbackError)?
(tarfile.TarFile._extract_member)?
(tarfile.TarFile.makelink_with_filter)?
(_?hashlib.new)?
(_?hashlib.(openssl_)?md5)?
(_?hashlib.(openssl_)?sha1)?
(_?hashlib.(openssl_)?sha224)?
(_?hashlib.(openssl_)?sha256)?
(_?hashlib.(openssl_)?sha384)?
(_?hashlib.(openssl_)?sha3_224)?
(_?hashlib.(openssl_)?sha3_256)?
(_?hashlib.(openssl_)?sha3_384)?
(_?hashlib.(openssl_)?sha3_512)?
(_?hashlib.(openssl_)?sha512)?
(_?hashlib.(openssl_)?shake_128)?
(_?hashlib.(openssl_)?shake_256)?
17 changes: 17 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,20 @@ _pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load
pickle.Pickler.persistent_id
pickle.Unpickler.persistent_load

# Incompatible changes introduced in Python 3.9.23
# (Remove once 3.9.23 becomes available for all platforms)
(email._header_value_parser.make_quoted_pairs)?
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
(ntpath.ALLOW_MISSING)?
(os.path.__all__)?
(os.path.ALLOW_MISSING)?
(os.path.realpath)?
(posixpath.__all__)?
(posixpath.ALLOW_MISSING)?
(posixpath.realpath)?
(tarfile.LinkFallbackError)?
(tarfile.TarFile._extract_member)?
(tarfile.TarFile.makelink_with_filter)?
4 changes: 4 additions & 0 deletions stdlib/@tests/stubtest_allowlists/win32-py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@ crypt
nis
ossaudiodev
spwd

# Incompatible changes introduced in Python 3.10.18
# (Remove once 3.10.18 becomes available for Windows)
(ntpath.realpath)?
4 changes: 4 additions & 0 deletions stdlib/@tests/stubtest_allowlists/win32-py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ crypt
nis
ossaudiodev
spwd

# Incompatible changes introduced in Python 3.11.13
# (Remove once 3.11.18 becomes available for Windows)
(ntpath.realpath)?
4 changes: 4 additions & 0 deletions stdlib/@tests/stubtest_allowlists/win32-py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ crypt
nis
ossaudiodev
spwd

# Incompatible changes introduced in Python 3.12.11
# (Remove once 3.12.11 becomes available for Windows)
(ntpath.realpath)?
4 changes: 4 additions & 0 deletions stdlib/@tests/stubtest_allowlists/win32-py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ crypt
nis
ossaudiodev
spwd

# Incompatible changes introduced in Python 3.9.23
# (Remove once 3.9.23 becomes available for Windows)
(ntpath.realpath)?
70 changes: 57 additions & 13 deletions stdlib/_hashlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,63 @@ def compare_digest(a: ReadableBuffer, b: ReadableBuffer, /) -> bool: ...
def compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ...
def get_fips_mode() -> int: ...
def hmac_new(key: bytes | bytearray, msg: ReadableBuffer = b"", digestmod: _DigestMod = None) -> HMAC: ...
def new(name: str, string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_md5(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha1(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_shake_128(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...
def openssl_shake_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...

if sys.version_info >= (3, 13):
def new(
name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_md5(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha1(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha224(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha256(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha384(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha512(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha3_224(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha3_256(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha3_384(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_sha3_512(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASH: ...
def openssl_shake_128(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASHXOF: ...
def openssl_shake_256(
data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None
) -> HASHXOF: ...

else:
def new(name: str, string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_md5(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha1(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_sha3_512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ...
def openssl_shake_128(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...
def openssl_shake_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ...

def hmac_digest(key: bytes | bytearray, msg: ReadableBuffer, digest: str) -> bytes: ...
def pbkdf2_hmac(
hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: int | None = None
Expand Down
3 changes: 2 additions & 1 deletion stdlib/_socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ if sys.platform != "win32":
IP_RECVOPTS: int
IP_RECVRETOPTS: int
IP_RETOPTS: int
if sys.version_info >= (3, 13) and sys.platform == "linux":
CAN_RAW_ERR_FILTER: int
if sys.version_info >= (3, 14):
IP_RECVTTL: int

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

if sys.platform == "linux":
CAN_RAW_ERR_FILTER: int
IP_FREEBIND: int
IP_RECVORIGDSTADDR: int
VMADDR_CID_LOCAL: int
Expand Down
7 changes: 2 additions & 5 deletions stdlib/email/_header_value_parser.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from collections.abc import Iterable, Iterator
from email.errors import HeaderParseError, MessageDefect
from email.policy import Policy
Expand All @@ -22,10 +21,8 @@ NLSET: Final[set[str]]
# Added in Python 3.9.20, 3.10.15, 3.11.10, 3.12.5
SPECIALSNL: Final[set[str]]

if sys.version_info >= (3, 10):
# Added in Python 3.10.17, 3.11.12, 3.12.9, 3.13.2 (may still be backported to 3.9)
def make_quoted_pairs(value: Any) -> str: ...

# Added in Python 3.9.23, 3.10.17, 3.11.12, 3.12.9, 3.13.2
def make_quoted_pairs(value: Any) -> str: ...
def quote_string(value: Any) -> str: ...

rfc2047_matcher: Pattern[str]
Expand Down
7 changes: 6 additions & 1 deletion stdlib/genericpath.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import os
import sys
from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRichComparisonT
from collections.abc import Sequence
from typing import Literal, overload
from typing import Literal, NewType, overload
from typing_extensions import LiteralString

__all__ = [
Expand All @@ -17,6 +17,7 @@ __all__ = [
"samefile",
"sameopenfile",
"samestat",
"ALLOW_MISSING",
]
if sys.version_info >= (3, 12):
__all__ += ["islink"]
Expand Down Expand Up @@ -57,3 +58,7 @@ if sys.version_info >= (3, 13):
def isjunction(path: StrOrBytesPath) -> bool: ...
def isdevdrive(path: StrOrBytesPath) -> bool: ...
def lexists(path: StrOrBytesPath) -> bool: ...

# Added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4
_AllowMissingType = NewType("_AllowMissingType", object)
ALLOW_MISSING: _AllowMissingType
17 changes: 7 additions & 10 deletions stdlib/ntpath.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import sys
from _typeshed import BytesPath, StrOrBytesPath, StrPath
from genericpath import (
ALLOW_MISSING as ALLOW_MISSING,
_AllowMissingType,
commonprefix as commonprefix,
exists as exists,
getatime as getatime,
Expand Down Expand Up @@ -89,6 +91,7 @@ __all__ = [
"sameopenfile",
"samestat",
"commonpath",
"ALLOW_MISSING",
]
if sys.version_info >= (3, 12):
__all__ += ["isjunction", "splitroot"]
Expand All @@ -108,16 +111,10 @@ def join(path: StrPath, /, *paths: StrPath) -> str: ...
def join(path: BytesPath, /, *paths: BytesPath) -> bytes: ...

if sys.platform == "win32":
if sys.version_info >= (3, 10):
@overload
def realpath(path: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ...
@overload
def realpath(path: AnyStr, *, strict: bool = False) -> AnyStr: ...
else:
@overload
def realpath(path: PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(path: AnyStr) -> AnyStr: ...
@overload
def realpath(path: PathLike[AnyStr], *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
@overload
def realpath(path: AnyStr, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...

else:
realpath = abspath
Expand Down
20 changes: 7 additions & 13 deletions stdlib/posixpath.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import sys
from _typeshed import AnyOrLiteralStr, BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath
from collections.abc import Iterable
from genericpath import (
ALLOW_MISSING as ALLOW_MISSING,
_AllowMissingType,
commonprefix as commonprefix,
exists as exists,
getatime as getatime,
Expand Down Expand Up @@ -61,6 +63,7 @@ __all__ = [
"relpath",
"commonpath",
]
__all__ += ["ALLOW_MISSING"]
if sys.version_info >= (3, 12):
__all__ += ["isjunction", "splitroot"]
if sys.version_info >= (3, 13):
Expand Down Expand Up @@ -122,19 +125,10 @@ def join(a: LiteralString, /, *paths: LiteralString) -> LiteralString: ...
def join(a: StrPath, /, *paths: StrPath) -> str: ...
@overload
def join(a: BytesPath, /, *paths: BytesPath) -> bytes: ...

if sys.version_info >= (3, 10):
@overload
def realpath(filename: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ...
@overload
def realpath(filename: AnyStr, *, strict: bool = False) -> AnyStr: ...

else:
@overload
def realpath(filename: PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(filename: AnyStr) -> AnyStr: ...

@overload
def realpath(filename: PathLike[AnyStr], *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
@overload
def realpath(filename: AnyStr, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
@overload
def relpath(path: LiteralString, start: LiteralString | None = None) -> LiteralString: ...
@overload
Expand Down
4 changes: 4 additions & 0 deletions stdlib/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,10 @@ if sys.platform == "linux":
if sys.version_info < (3, 11):
from _socket import CAN_RAW_ERR_FILTER as CAN_RAW_ERR_FILTER

__all__ += ["CAN_RAW_ERR_FILTER"]
if sys.version_info >= (3, 13):
from _socket import CAN_RAW_ERR_FILTER as CAN_RAW_ERR_FILTER

__all__ += ["CAN_RAW_ERR_FILTER"]

if sys.platform == "linux":
Expand Down
Loading