Skip to content

Commit b7bc6f3

Browse files
max-muotopre-commit-ci[bot]JelleZijlstra
authored
Update gzip for 3.14 (#14237)
* Update gzip for 3.14 * [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent bacccd0 commit b7bc6f3

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
# TODO: New errors in Python 3.14 that need to be fixed or moved below
33
# ====================================================================
44

5-
compression.gzip.GzipFile.readinto
6-
compression.gzip.GzipFile.readinto
7-
compression.gzip.GzipFile.readinto1
8-
compression.gzip.GzipFile.readinto1
9-
compression.gzip.compress
10-
gzip.GzipFile.readinto
11-
gzip.GzipFile.readinto1
12-
gzip.compress
135
multiprocessing.managers.BaseListProxy.clear
146
multiprocessing.managers.BaseListProxy.copy
157
multiprocessing.managers.DictProxy.__ior__

stdlib/gzip.pyi

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
import zlib
3-
from _typeshed import ReadableBuffer, SizedBuffer, StrOrBytesPath
3+
from _typeshed import ReadableBuffer, SizedBuffer, StrOrBytesPath, WriteableBuffer
44
from io import FileIO, TextIOWrapper
55
from typing import Final, Literal, Protocol, overload
66
from typing_extensions import TypeAlias
@@ -157,8 +157,17 @@ class GzipFile(BaseStream):
157157
def seek(self, offset: int, whence: int = 0) -> int: ...
158158
def readline(self, size: int | None = -1) -> bytes: ...
159159

160+
if sys.version_info >= (3, 14):
161+
def readinto(self, b: WriteableBuffer) -> int: ...
162+
def readinto1(self, b: WriteableBuffer) -> int: ...
163+
160164
class _GzipReader(DecompressReader):
161165
def __init__(self, fp: _ReadableFileobj) -> None: ...
162166

163-
def compress(data: SizedBuffer, compresslevel: int = 9, *, mtime: float | None = None) -> bytes: ...
167+
if sys.version_info >= (3, 14):
168+
def compress(data: SizedBuffer, compresslevel: int = 9, *, mtime: float = 0) -> bytes: ...
169+
170+
else:
171+
def compress(data: SizedBuffer, compresslevel: int = 9, *, mtime: float | None = None) -> bytes: ...
172+
164173
def decompress(data: ReadableBuffer) -> bytes: ...

0 commit comments

Comments
 (0)