Skip to content

Commit

Permalink
Compress all wheel content with explicit ZIP_DEFLATED (#715) (#838)
Browse files Browse the repository at this point in the history
https://docs.python.org/2/library/zipfile.html#zipfile.ZipFile.writestr

Note: When passing a ZipInfo instance as the zinfo_or_arcname parameter,
the compression method used will be that specified in the compress_type
member of the given ZipInfo instance. By default, the ZipInfo
constructor sets this member to ZIP_STORED.
  • Loading branch information
ccosby authored and sdispater committed Mar 6, 2019
1 parent 4f21527 commit 6fe7f54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion poetry/masonry/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def _add_file(self, wheel, full_path, rel_path):
hashsum.update(buf)

src.seek(0)
wheel.writestr(zinfo, src.read())
wheel.writestr(zinfo, src.read(), compress_type=zipfile.ZIP_DEFLATED)

size = os.stat(full_path).st_size
hash_digest = urlsafe_b64encode(hashsum.digest()).decode("ascii").rstrip("=")
Expand Down

0 comments on commit 6fe7f54

Please sign in to comment.