summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernat Gabor <bgabor8@bloomberg.net>2020-02-26 10:41:39 +0000
committerBernat Gabor <bgabor8@bloomberg.net>2020-02-26 10:43:50 +0000
commit21ba7aa7ee7bd7396a223a387279f8d4bb514c72 (patch)
tree73c7875d28516d6636cfff32c0c1d13d4bf63eec
parenta48c4dd8df8b96736af8fd0cc5f3c8e2ce857917 (diff)
downloadvirtualenv-release-20.0.6.tar.gz
fix relative zipapp paths on UNIX20.0.6release-20.0.6
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
-rw-r--r--docs/changelog.rst2
-rw-r--r--src/virtualenv/util/zipapp.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 6ab4ca0..669c359 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -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)
--------------------
diff --git a/src/virtualenv/util/zipapp.py b/src/virtualenv/util/zipapp.py
index 698cc3e..36cee5e 100644
--- a/src/virtualenv/util/zipapp.py
+++ b/src/virtualenv/util/zipapp.py
@@ -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, "/")