Skip to content

Commit d79501c

Browse files
committed
Removed features slated for Python 3.15 only.
1 parent bf614c9 commit d79501c

File tree

3 files changed

+13
-39
lines changed

3 files changed

+13
-39
lines changed

Lib/zipfile/_path/__init__.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
for more detail.
88
"""
99

10-
import functools
10+
import contextlib
1111
import io
1212
import itertools
1313
import pathlib
@@ -17,7 +17,6 @@
1717
import sys
1818
import zipfile
1919

20-
from ._functools import save_method_args
2120
from .glob import Translator
2221

2322
__all__ = ['Path']
@@ -86,12 +85,13 @@ class InitializedState:
8685
Mix-in to save the initialization state for pickling.
8786
"""
8887

89-
@save_method_args
9088
def __init__(self, *args, **kwargs):
89+
self.__args = args
90+
self.__kwargs = kwargs
9191
super().__init__(*args, **kwargs)
9292

9393
def __getstate__(self):
94-
return self._saved___init__.args, self._saved___init__.kwargs
94+
return self.__args, self.__kwargs
9595

9696
def __setstate__(self, state):
9797
args, kwargs = state
@@ -180,19 +180,16 @@ class FastLookup(CompleteDirs):
180180
"""
181181

182182
def namelist(self):
183-
return self._namelist
184-
185-
@functools.cached_property
186-
def _namelist(self):
187-
return super().namelist()
183+
with contextlib.suppress(AttributeError):
184+
return self.__names
185+
self.__names = super().namelist()
186+
return self.__names
188187

189188
def _name_set(self):
190-
return self._name_set_prop
191-
192-
@functools.cached_property
193-
def _name_set_prop(self):
194-
return super()._name_set()
195-
189+
with contextlib.suppress(AttributeError):
190+
return self.__lookup
191+
self.__lookup = super()._name_set()
192+
return self.__lookup
196193

197194
def _extract_text_encoding(encoding=None, *args, **kwargs):
198195
# compute stack level so that the caller of the caller sees any warning.

Lib/zipfile/_path/_functools.py

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
Synchronized zipfile.Path with zipp 3.23, including improved performance of
2-
:meth:`zipfile.Path.open` for non-reading modes, rely on
3-
:func:`functools.cached_property` to cache values on the instance. Rely on
4-
``save_method_args`` to save the initialization method arguments. Fixed
1+
Backported bugfixes in zipfile.Path from zipp 3.23. Fixed
52
``.name``, ``.stem`` and other basename-based properties on Windows when
63
working with a zipfile on disk.

0 commit comments

Comments
 (0)