bpo-46951: Order contents of zipapps (GH-31713)

So that builds are more reproducible.
This commit is contained in:
hfinucane 2022-05-27 09:04:29 -07:00 committed by GitHub
parent bbcf42449e
commit 47e68d4515
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View file

@ -136,7 +136,7 @@ def create_archive(source, target=None, interpreter=None, main=None,
compression = (zipfile.ZIP_DEFLATED if compressed else
zipfile.ZIP_STORED)
with zipfile.ZipFile(fd, 'w', compression=compression) as z:
for child in source.rglob('*'):
for child in sorted(source.rglob('*')):
arcname = child.relative_to(source)
if filter is None or filter(arcname):
z.write(child, arcname.as_posix())