Permalink
Browse files

Merge pull request #320 from jkleint/develop

Fix assert error when virtual path shares a common prefix with real path
  • Loading branch information...
2 parents 4cd1a4d + 82b894d commit 98b8160d059783141a39e74d0aaf8a276ecb57e9 @pnasrat pnasrat committed Oct 19, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 virtualenv.py
View
@@ -1134,6 +1134,8 @@ def change_prefix(filename, dst_prefix):
prefixes.append(sys.base_prefix)
prefixes = list(map(os.path.expanduser, prefixes))
prefixes = list(map(os.path.abspath, prefixes))
+ # Check longer prefixes first so we don't split in the middle of a filename
+ prefixes = sorted(prefixes, key=len, reverse=True)
filename = os.path.abspath(filename)
for src_prefix in prefixes:
if filename.startswith(src_prefix):

0 comments on commit 98b8160

Please sign in to comment.