Skip to content

Commit

Permalink
fix relative zipapp paths on UNIX
Browse files Browse the repository at this point in the history
Signed-off-by: Bernat Gabor <[email protected]>
  • Loading branch information
gaborbernat committed Feb 26, 2020
1 parent a48c4dd commit 21ba7aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Bugfixes - 20.0.6
by :user:`gaborbernat`. (`#1640 <https://github.com/pypa/virtualenv/issues/1640>`_)
- Fix PyPy 2 builtin modules are imported from standard library, rather than from builtin - by :user:`gaborbernat`. (`#1652 <https://github.com/pypa/virtualenv/issues/1652>`_)
- Fix creation of entry points when path contains spaces - by :user:`nsoranzo`. (`#1660 <https://github.com/pypa/virtualenv/issues/1660>`_)

- Fix relative paths for the zipapp (for python ``3.7+``) - by :user:`gaborbernat`. (`#1666 <https://github.com/pypa/virtualenv/issues/1666>`_)

v20.0.5 (2020-02-21)
--------------------
Expand Down
3 changes: 2 additions & 1 deletion src/virtualenv/util/zipapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def extract(full_path, dest):


def _get_path_within_zip(full_path):
sub_file = str(full_path)[len(ROOT) + 1 :]
full_path = os.path.abspath(str(full_path))
sub_file = full_path[len(ROOT) + 1 :]
if IS_WIN:
# paths are always UNIX separators, even on Windows, though __file__ still follows platform default
sub_file = sub_file.replace(os.sep, "/")
Expand Down

0 comments on commit 21ba7aa

Please sign in to comment.