Skip to content

Commit

Permalink
fix: fix unpacking on letter-less Windows drives
Browse files Browse the repository at this point in the history
  • Loading branch information
grv87 committed Jul 8, 2022
1 parent 5f12c59 commit 066505d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pip/_internal/utils/unpacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def unzip_file(filename: str, location: str, flatten: bool = True) -> None:
fn = name
if leading:
fn = split_leading_dir(name)[1]
fn = os.path.join(location, fn)
fn = location if fn == "" else os.path.join(location, os.path.normpath(fn))
dir = os.path.dirname(fn)
if not is_within_directory(location, fn):
message = (
Expand Down Expand Up @@ -177,7 +177,7 @@ def untar_file(filename: str, location: str) -> None:
fn = member.name
if leading:
fn = split_leading_dir(fn)[1]
path = os.path.join(location, fn)
path = location if fn == "" else os.path.join(location, os.path.normpath(fn))
if not is_within_directory(location, path):
message = (
"The tar file ({}) has a file ({}) trying to install "
Expand Down

0 comments on commit 066505d

Please sign in to comment.