##// END OF EJS Templates
windows: degrade to py2 behavior when reading a non-symlink as a symlink...
Matt Harbison -
r48680:4162f6b4 stable
parent child Browse files
Show More
@@ -616,7 +616,16 b' def groupname(gid=None):'
616
616
617
617
618 def readlink(pathname):
618 def readlink(pathname):
619 return pycompat.fsencode(os.readlink(pycompat.fsdecode(pathname)))
619 path = pycompat.fsdecode(pathname)
620 try:
621 link = os.readlink(path)
622 except ValueError as e:
623 # On py2, os.readlink() raises an AttributeError since it is
624 # unsupported. On py3, reading a non-link raises a ValueError. Simply
625 # treat this as the error the locking code has been expecting up to now
626 # until an effort can be made to enable symlink support on Windows.
627 raise AttributeError(e)
628 return pycompat.fsencode(link)
620
629
621
630
622 def removedirs(name):
631 def removedirs(name):
General Comments 0
You need to be logged in to leave comments. Login now