From 0e91d4adbbdd60a55f982ce61e898a173e2a5587 Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Sat, 1 Jun 2024 21:03:14 +0000 Subject: [PATCH 1/3] zipfile: Python 3.13 updates --- stdlib/@tests/stubtest_allowlists/py313.txt | 3 --- stdlib/zipfile/__init__.pyi | 2 ++ stdlib/zipfile/_path.pyi | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 876800c00d41..22ddb9b666ec 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -179,9 +179,6 @@ unittest.makeSuite unittest.mock.NonCallableMock._calls_repr unittest.mock.ThreadingMock unittest.mock.__all__ -zipfile.CompleteDirs.inject -zipfile.ZipInfo.compress_level -zipfile._path.CompleteDirs.inject # ====================================== # Pre-existing errors from Python <=3.12 diff --git a/stdlib/zipfile/__init__.pyi b/stdlib/zipfile/__init__.pyi index b61e07f8b90d..e16c486fa220 100644 --- a/stdlib/zipfile/__init__.pyi +++ b/stdlib/zipfile/__init__.pyi @@ -206,6 +206,8 @@ class ZipInfo: compress_size: int file_size: int orig_filename: str # undocumented + if sys.version_info >= (3, 13): + compress_level: int | None def __init__(self, filename: str = "NoName", date_time: _DateTuple = (1980, 1, 1, 0, 0, 0)) -> None: ... @classmethod def from_file(cls, filename: StrPath, arcname: StrPath | None = None, *, strict_timestamps: bool = True) -> Self: ... diff --git a/stdlib/zipfile/_path.pyi b/stdlib/zipfile/_path.pyi index 0398824e1fd2..1d23bd8efae4 100644 --- a/stdlib/zipfile/_path.pyi +++ b/stdlib/zipfile/_path.pyi @@ -23,6 +23,9 @@ if sys.version_info >= (3, 12): @overload @classmethod def make(cls, source: StrPath | IO[bytes]) -> Self: ... + if sys.version_info >= (3, 13): + @classmethod + def inject(cls, zf: ZipFile) -> ZipFile: ... class Path: root: CompleteDirs From fa107dc7f341db4da7fdac6b28f0ce6e06809c49 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:08:59 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/zipfile/__init__.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/zipfile/__init__.pyi b/stdlib/zipfile/__init__.pyi index e16c486fa220..aa52a0b56e41 100644 --- a/stdlib/zipfile/__init__.pyi +++ b/stdlib/zipfile/__init__.pyi @@ -208,6 +208,7 @@ class ZipInfo: orig_filename: str # undocumented if sys.version_info >= (3, 13): compress_level: int | None + def __init__(self, filename: str = "NoName", date_time: _DateTuple = (1980, 1, 1, 0, 0, 0)) -> None: ... @classmethod def from_file(cls, filename: StrPath, arcname: StrPath | None = None, *, strict_timestamps: bool = True) -> Self: ... From bc65e9bb66eafe875fda954e82d91c3d542ef2a5 Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Mon, 3 Jun 2024 07:01:09 +0000 Subject: [PATCH 3/3] threading update --- stdlib/@tests/stubtest_allowlists/py313.txt | 1 - stdlib/threading.pyi | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 22ddb9b666ec..c29a4b0c0c23 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -129,7 +129,6 @@ site.register_readline sre_compile.SRE_FLAG_TEMPLATE sre_constants.SRE_FLAG_TEMPLATE sre_parse.SRE_FLAG_TEMPLATE -threading.stack_size tkinter.Misc.after_info tkinter.Misc.busy tkinter.Misc.busy_cget diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index 1ecadef508d0..506221723824 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -61,7 +61,7 @@ if sys.version_info >= (3, 10): def gettrace() -> TraceFunction | None: ... def getprofile() -> ProfileFunction | None: ... -def stack_size(size: int = ...) -> int: ... +def stack_size(size: int = ..., /) -> int: ... TIMEOUT_MAX: float