Skip to content

Commit 75fc33d

Browse files
authored
Update zoneinfo for Python3.12 (#10304)
1 parent 85a6dd1 commit 75fc33d

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

stdlib/zoneinfo/__init__.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class ZoneInfo(tzinfo):
1717
@classmethod
1818
def no_cache(cls, key: str) -> Self: ...
1919
@classmethod
20-
def from_file(cls, __fobj: _IOBytes, key: str | None = ...) -> Self: ...
20+
def from_file(cls, __fobj: _IOBytes, key: str | None = None) -> Self: ...
2121
@classmethod
22-
def clear_cache(cls, *, only_keys: Iterable[str] | None = ...) -> None: ...
22+
def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None: ...
2323
def tzname(self, __dt: datetime | None) -> str | None: ...
2424
def utcoffset(self, __dt: datetime | None) -> timedelta | None: ...
2525
def dst(self, __dt: datetime | None) -> timedelta | None: ...
@@ -30,7 +30,7 @@ class ZoneInfo(tzinfo):
3030
def reset_tzpath(to: Sequence[StrPath] | None = None) -> None: ...
3131
def available_timezones() -> set[str]: ...
3232

33-
TZPATH: Sequence[str]
33+
TZPATH: tuple[str, ...]
3434

3535
class ZoneInfoNotFoundError(KeyError): ...
3636
class InvalidTZPathWarning(RuntimeWarning): ...

tests/stubtest_allowlists/py312.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ zipfile.Path.is_symlink
188188
zipfile.Path.match
189189
zipfile.Path.relative_to
190190
zipfile.Path.rglob
191-
zoneinfo.ZoneInfo.from_file
192191

193192
# Errors that also existed on Python 3.11
194193
_collections_abc.AsyncGenerator.ag_await
@@ -259,6 +258,9 @@ posixpath.join
259258
ntpath.join
260259
os.path.join
261260

261+
# Pos-only parameters had different "names" in different Python versions:
262+
zoneinfo.ZoneInfo.from_file
263+
262264
# ==========
263265
# Allowlist entries that cannot or should not be fixed
264266
# ==========

0 commit comments

Comments
 (0)