[PATCH 4 of 4] py3: convert os.readlink() path to native strings
Matt Harbison
mharbison72 at gmail.com
Wed Sep 26 23:12:56 EDT 2018
# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1537924572 14400
# Tue Sep 25 21:16:12 2018 -0400
# Node ID d7aa84fbb3da463c68190aa746cbc6af40c6b8bc
# Parent 549bc25529a2d8d1c67736110c90491cc1eafc76
py3: convert os.readlink() path to native strings
Windows insisted that it needs to be str. I skipped the stuff that's obviously
posix only, and left `tests/f` and `run-tests.py` alone for now.
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1841,7 +1841,7 @@ def makelock(info, pathname):
def readlock(pathname):
try:
- return os.readlink(pathname)
+ return os.readlink(pycompat.fsdecode(pathname))
except OSError as why:
if why.errno not in (errno.EINVAL, errno.ENOSYS):
raise
diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -206,7 +206,7 @@ class abstractvfs(object):
return util.rename(srcpath, dstpath)
def readlink(self, path):
- return os.readlink(self.join(path))
+ return os.readlink(pycompat.fsdecode(self.join(path)))
def removedirs(self, path=None):
"""Remove a leaf directory and all empty intermediate ones
More information about the Mercurial-devel
mailing list