Skip to content

Commit

Permalink
pythongh-104527: zippapp will now avoid appending an archive to itsel…
Browse files Browse the repository at this point in the history
…f. (pythongh-106076)

zippapp will now avoid appending an archive to itself.
  • Loading branch information
gabevenberg committed Jun 26, 2023
1 parent a12e8ff commit dac3d38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/zipapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def create_archive(source, target=None, interpreter=None, main=None,
with zipfile.ZipFile(fd, 'w', compression=compression) as z:
for child in sorted(source.rglob('*')):
arcname = child.relative_to(source)
if filter is None or filter(arcname):
if filter is None or filter(arcname) and child.resolve() != arcname.resolve():
z.write(child, arcname.as_posix())
if main_py:
z.writestr('__main__.py', main_py.encode('utf-8'))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Zipapp will now skip over apending an archive to itself.

0 comments on commit dac3d38

Please sign in to comment.