Skip to content

Commit

Permalink
In zip namespace fixtures, explicitly generate the directory entries …
Browse files Browse the repository at this point in the history
…implied by children. Workaround for python/cpython#59110.
  • Loading branch information
jaraco committed Sep 18, 2023
1 parent 023d2c1 commit d3a7f69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions importlib_resources/tests/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import pathlib
import zipfile

import zipp


def make_zip_file(src, dst):
"""
Expand All @@ -16,6 +18,7 @@ def make_zip_file(src, dst):
for src_path, rel in walk(src):
dst_name = src.name / pathlib.PurePosixPath(rel.as_posix())
zf.write(src_path, dst_name)
zipp.CompleteDirs.inject(zf)
return dst


Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ testing =
pytest-ruff

# local
zipp >= 3.17

docs =
# upstream
Expand Down

0 comments on commit d3a7f69

Please sign in to comment.