Bug #1213894: os.path.realpath didn't resolve symlinks that were the first

component of the path.
This commit is contained in:
Georg Brandl 2005-06-03 14:28:50 +00:00
parent 5661699995
commit 268e61cf74
3 changed files with 24 additions and 1 deletions

View file

@ -414,7 +414,7 @@ symbolic links encountered in the path."""
if isabs(filename):
bits = ['/'] + filename.split('/')[1:]
else:
bits = filename.split('/')
bits = [''] + filename.split('/')
for i in range(2, len(bits)+1):
component = join(*bits[0:i])