diff --git a/stdlib/@tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt index 1cb422f3c9a5..d2030f8713be 100644 --- a/stdlib/@tests/stubtest_allowlists/py310.txt +++ b/stdlib/@tests/stubtest_allowlists/py310.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt index 80b55805b3e6..e4c26ccfcf1f 100644 --- a/stdlib/@tests/stubtest_allowlists/py311.txt +++ b/stdlib/@tests/stubtest_allowlists/py311.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/py312.txt b/stdlib/@tests/stubtest_allowlists/py312.txt index a424779a4f9b..c9bfee549a28 100644 --- a/stdlib/@tests/stubtest_allowlists/py312.txt +++ b/stdlib/@tests/stubtest_allowlists/py312.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 6d312dacd027..e376fbe82ae0 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/py39.txt b/stdlib/@tests/stubtest_allowlists/py39.txt index 571e2c76c894..37c1ec2ad171 100644 --- a/stdlib/@tests/stubtest_allowlists/py39.txt +++ b/stdlib/@tests/stubtest_allowlists/py39.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/win32-py310.txt b/stdlib/@tests/stubtest_allowlists/win32-py310.txt index 4bc95349eedb..15005e65d04a 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py310.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py310.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/win32-py311.txt b/stdlib/@tests/stubtest_allowlists/win32-py311.txt index 771e0a090c78..5e882c194a66 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py311.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py311.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/win32-py312.txt b/stdlib/@tests/stubtest_allowlists/win32-py312.txt index 8c7e5fa72a73..3e5762cbf3d1 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py312.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py312.txt @@ -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)? diff --git a/stdlib/@tests/stubtest_allowlists/win32-py39.txt b/stdlib/@tests/stubtest_allowlists/win32-py39.txt index 3ab6c98d454e..2d712bda1e01 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py39.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py39.txt @@ -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)? diff --git a/stdlib/_hashlib.pyi b/stdlib/_hashlib.pyi index 746b1657e2db..8b7ef52cdffd 100644 --- a/stdlib/_hashlib.pyi +++ b/stdlib/_hashlib.pyi @@ -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 diff --git a/stdlib/_socket.pyi b/stdlib/_socket.pyi index 06a8a2ba5fa0..41fdce87ec14 100644 --- a/stdlib/_socket.pyi +++ b/stdlib/_socket.pyi @@ -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 @@ -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 diff --git a/stdlib/email/_header_value_parser.pyi b/stdlib/email/_header_value_parser.pyi index a8abfead9217..95ada186c4ec 100644 --- a/stdlib/email/_header_value_parser.pyi +++ b/stdlib/email/_header_value_parser.pyi @@ -1,4 +1,3 @@ -import sys from collections.abc import Iterable, Iterator from email.errors import HeaderParseError, MessageDefect from email.policy import Policy @@ -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] diff --git a/stdlib/genericpath.pyi b/stdlib/genericpath.pyi index 9d87c48fd520..3caed77a661a 100644 --- a/stdlib/genericpath.pyi +++ b/stdlib/genericpath.pyi @@ -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__ = [ @@ -17,6 +17,7 @@ __all__ = [ "samefile", "sameopenfile", "samestat", + "ALLOW_MISSING", ] if sys.version_info >= (3, 12): __all__ += ["islink"] @@ -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 diff --git a/stdlib/ntpath.pyi b/stdlib/ntpath.pyi index ebe305ef708c..074df075b972 100644 --- a/stdlib/ntpath.pyi +++ b/stdlib/ntpath.pyi @@ -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, @@ -89,6 +91,7 @@ __all__ = [ "sameopenfile", "samestat", "commonpath", + "ALLOW_MISSING", ] if sys.version_info >= (3, 12): __all__ += ["isjunction", "splitroot"] @@ -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 diff --git a/stdlib/posixpath.pyi b/stdlib/posixpath.pyi index 3313667f1781..84e1b1e028bd 100644 --- a/stdlib/posixpath.pyi +++ b/stdlib/posixpath.pyi @@ -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, @@ -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): @@ -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 diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index 1ee006235ee6..b4fa4381a72c 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -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": diff --git a/stdlib/tarfile.pyi b/stdlib/tarfile.pyi index 31094f87872d..a18ef0b823f9 100644 --- a/stdlib/tarfile.pyi +++ b/stdlib/tarfile.pyi @@ -38,6 +38,8 @@ if sys.version_info >= (3, 12): "AbsolutePathError", "LinkOutsideDestinationError", ] +if sys.version_info >= (3, 13): + __all__ += ["LinkFallbackError"] _FilterFunction: TypeAlias = Callable[[TarInfo, str], TarInfo | None] _TarfileFilter: TypeAlias = Literal["fully_trusted", "tar", "data"] | _FilterFunction @@ -550,7 +552,14 @@ class TarFile: filter: _TarfileFilter | None = ..., ) -> None: ... def _extract_member( - self, tarinfo: TarInfo, targetpath: str, set_attrs: bool = True, numeric_owner: bool = False + self, + tarinfo: TarInfo, + targetpath: str, + set_attrs: bool = True, + numeric_owner: bool = False, + *, + filter_function: _FilterFunction | None = None, + extraction_root: str | None = None, ) -> None: ... # undocumented def extractfile(self, member: str | TarInfo) -> IO[bytes] | None: ... def makedir(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented @@ -559,6 +568,9 @@ class TarFile: def makefifo(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented def makedev(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented def makelink(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented + def makelink_with_filter( + self, tarinfo: TarInfo, targetpath: StrOrBytesPath, filter_function: _FilterFunction, extraction_root: str + ) -> None: ... # undocumented def chown(self, tarinfo: TarInfo, targetpath: StrOrBytesPath, numeric_owner: bool) -> None: ... # undocumented def chmod(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented def utime(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented @@ -607,6 +619,9 @@ class AbsoluteLinkError(FilterError): class LinkOutsideDestinationError(FilterError): def __init__(self, tarinfo: TarInfo, path: str) -> None: ... +class LinkFallbackError(FilterError): + def __init__(self, tarinfo: TarInfo, path: str) -> None: ... + def fully_trusted_filter(member: TarInfo, dest_path: str) -> TarInfo: ... def tar_filter(member: TarInfo, dest_path: str) -> TarInfo: ... def data_filter(member: TarInfo, dest_path: str) -> TarInfo: ...