From 75fc33d8d071bd86c192639175ead8108a8b2fe5 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 12 Jun 2023 12:34:03 +0300 Subject: [PATCH] Update zoneinfo for Python3.12 (#10304) --- stdlib/zoneinfo/__init__.pyi | 6 +++--- tests/stubtest_allowlists/py312.txt | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/stdlib/zoneinfo/__init__.pyi b/stdlib/zoneinfo/__init__.pyi index fe994be3e..a95530ed4 100644 --- a/stdlib/zoneinfo/__init__.pyi +++ b/stdlib/zoneinfo/__init__.pyi @@ -17,9 +17,9 @@ class ZoneInfo(tzinfo): @classmethod def no_cache(cls, key: str) -> Self: ... @classmethod - def from_file(cls, __fobj: _IOBytes, key: str | None = ...) -> Self: ... + def from_file(cls, __fobj: _IOBytes, key: str | None = None) -> Self: ... @classmethod - def clear_cache(cls, *, only_keys: Iterable[str] | None = ...) -> None: ... + def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None: ... def tzname(self, __dt: datetime | None) -> str | None: ... def utcoffset(self, __dt: datetime | None) -> timedelta | None: ... def dst(self, __dt: datetime | None) -> timedelta | None: ... @@ -30,7 +30,7 @@ class ZoneInfo(tzinfo): def reset_tzpath(to: Sequence[StrPath] | None = None) -> None: ... def available_timezones() -> set[str]: ... -TZPATH: Sequence[str] +TZPATH: tuple[str, ...] class ZoneInfoNotFoundError(KeyError): ... class InvalidTZPathWarning(RuntimeWarning): ... diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 1b308d94a..2d84be031 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -188,7 +188,6 @@ zipfile.Path.is_symlink zipfile.Path.match zipfile.Path.relative_to zipfile.Path.rglob -zoneinfo.ZoneInfo.from_file # Errors that also existed on Python 3.11 _collections_abc.AsyncGenerator.ag_await @@ -259,6 +258,9 @@ posixpath.join ntpath.join os.path.join +# Pos-only parameters had different "names" in different Python versions: +zoneinfo.ZoneInfo.from_file + # ========== # Allowlist entries that cannot or should not be fixed # ==========