Skip to content

Commit d3a7f69

Browse files
committed
In zip namespace fixtures, explicitly generate the directory entries implied by children. Workaround for python/cpython#59110.
1 parent 023d2c1 commit d3a7f69

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

importlib_resources/tests/zip.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import pathlib
88
import zipfile
99

10+
import zipp
11+
1012

1113
def make_zip_file(src, dst):
1214
"""
@@ -16,6 +18,7 @@ def make_zip_file(src, dst):
1618
for src_path, rel in walk(src):
1719
dst_name = src.name / pathlib.PurePosixPath(rel.as_posix())
1820
zf.write(src_path, dst_name)
21+
zipp.CompleteDirs.inject(zf)
1922
return dst
2023

2124

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ testing =
4444
pytest-ruff
4545

4646
# local
47+
zipp >= 3.17
4748

4849
docs =
4950
# upstream

0 commit comments

Comments
 (0)