diff -r 7558cee89655 -r e618a1756b08 mercurial/windows.py --- a/mercurial/windows.py Thu Jul 18 22:46:36 2024 -0400 +++ b/mercurial/windows.py Fri Jul 19 16:38:53 2024 -0400 @@ -620,10 +620,10 @@ return None -def readlink(pathname: bytes) -> bytes: - path = pycompat.fsdecode(pathname) +def readlink(path: bytes) -> bytes: + path_str = pycompat.fsdecode(path) try: - link = os.readlink(path) + link = os.readlink(path_str) except ValueError as e: # On py2, os.readlink() raises an AttributeError since it is # unsupported. On py3, reading a non-link raises a ValueError. Simply