py3: pass a system-string filename to sub-classes of IOError
authorYuya Nishihara <yuya@tcha.org>
Sat, 03 Mar 2018 10:08:13 -0500
changeset 36640 c77c925987d7
parent 36639 334da951a50b
child 36641 77f98867538f
py3: pass a system-string filename to sub-classes of IOError
mercurial/lock.py
mercurial/statichttprepo.py
--- a/mercurial/lock.py	Sat Mar 03 09:19:34 2018 -0500
+++ b/mercurial/lock.py	Sat Mar 03 10:08:13 2018 -0500
@@ -198,9 +198,10 @@
                         return
                     locker = self._testlock(locker)
                     if locker is not None:
-                        raise error.LockHeld(errno.EAGAIN,
-                                             self.vfs.join(self.f), self.desc,
-                                             locker)
+                        raise error.LockHeld(
+                            errno.EAGAIN,
+                            encoding.strfromlocal(self.vfs.join(self.f)),
+                            self.desc, locker)
                 else:
                     raise error.LockUnavailable(why.errno, why.strerror,
                                                 why.filename, self.desc)
@@ -209,7 +210,8 @@
             # use empty locker to mean "busy for frequent lock/unlock
             # by many processes"
             raise error.LockHeld(errno.EAGAIN,
-                                 self.vfs.join(self.f), self.desc, "")
+                                 encoding.strfromlocal(self.vfs.join(self.f)),
+                                 self.desc, "")
 
     def _readlock(self):
         """read lock and return its value
--- a/mercurial/statichttprepo.py	Sat Mar 03 09:19:34 2018 -0500
+++ b/mercurial/statichttprepo.py	Sat Mar 03 10:08:13 2018 -0500
@@ -206,7 +206,7 @@
         return statichttppeer(self)
 
     def wlock(self, wait=True):
-        raise error.LockUnavailable(0, _('lock not available'), 'lock',
+        raise error.LockUnavailable(0, _('lock not available'), r'lock',
                                     _('cannot lock static-http repository'))
 
     def lock(self, wait=True):