Skip to content

Commit

Permalink
Merge pull request #3843 from pypa/resolve-symlink
Browse files Browse the repository at this point in the history
Make sure symlinks are resolved.
  • Loading branch information
frostming committed Jul 13, 2019
2 parents 9c51b34 + 472612b commit 47b310d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions news/3842.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Resolve the symlinks when the path is absolute.
9 changes: 4 additions & 5 deletions pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ def _normalized(p):
if p is None:
return None
loc = vistir.compat.Path(p)
if not loc.is_absolute():
try:
loc = loc.resolve()
except OSError:
loc = loc.absolute()
try:
loc = loc.resolve()
except OSError:
loc = loc.absolute()
# Recase the path properly on Windows. From https://stackoverflow.com/a/35229734/5043728
if os.name == 'nt':
matches = glob.glob(re.sub(r'([^:/\\])(?=[/\\]|$)', r'[\1]', str(loc)))
Expand Down

0 comments on commit 47b310d

Please sign in to comment.