Skip to content

Commit

Permalink
Merge pull request #51 from isuruf/separator
Browse files Browse the repository at this point in the history
MRG: Fix path separator on windows
  • Loading branch information
matthew-brett authored Apr 27, 2019
2 parents db03caa + 5be0e92 commit ed48de1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions delocate/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ def dir2zip(in_dir, zip_fname):
# Preserve file permissions, but allow copy
info = zipfile.ZipInfo(in_fname)
info.filename = relpath(in_fname, in_dir)
if os.path.sep == '\\':
# Make the path unix friendly on windows.
# PyPI won't accept wheels with windows path separators
info.filename = relpath(in_fname, in_dir).replace('\\', '/')
# Set time from modification time
info.date_time = time.localtime(in_stat.st_mtime)
# See https://stackoverflow.com/questions/434641/how-do-i-set-permissions-attributes-on-a-file-in-a-zip-file-using-pythons-zip/48435482#48435482
Expand Down

0 comments on commit ed48de1

Please sign in to comment.