Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions stdlib/zipfile/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>>> import zipfile
>>> zipfile.ZipInfo.from_file("sample.zip").compress_level is None
True

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: ...
Expand Down
3 changes: 3 additions & 0 deletions stdlib/zipfile/_path.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a public method but missing from the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@AlexWaygood AlexWaygood Jun 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's documented at https://zipp.readthedocs.io/en/latest/history.html#id8, so it does indeed seem like it's meant to be public. (You're right that it should also definitely be documented in the CPython docs as well!)


class Path:
root: CompleteDirs
Expand Down