Patchwork [1,of,2] py3: back out c77c925987d7 to store bytes filename in IOError

login
register
mail settings
Submitter Yuya Nishihara
Date March 3, 2018, 8:52 p.m.
Message ID <8e3fd6529bad7f4d524f.1520110360@mimosa>
Download mbox | patch
Permalink /patch/28841/
State Accepted
Headers show

Comments

Yuya Nishihara - March 3, 2018, 8:52 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1520109232 18000
#      Sat Mar 03 15:33:52 2018 -0500
# Node ID 8e3fd6529bad7f4d524f160761c766a7f5267a0f
# Parent  68026dd7c4f9bf1462c15a2a307d4bb253a0959f
py3: back out c77c925987d7 to store bytes filename in IOError

Appears that this is how Python 3 works.

Patch

diff --git a/mercurial/lock.py b/mercurial/lock.py
--- a/mercurial/lock.py
+++ b/mercurial/lock.py
@@ -200,10 +200,9 @@  class lock(object):
                         return
                     locker = self._testlock(locker)
                     if locker is not None:
-                        raise error.LockHeld(
-                            errno.EAGAIN,
-                            encoding.strfromlocal(self.vfs.join(self.f)),
-                            self.desc, locker)
+                        raise error.LockHeld(errno.EAGAIN,
+                                             self.vfs.join(self.f), self.desc,
+                                             locker)
                 else:
                     raise error.LockUnavailable(why.errno, why.strerror,
                                                 why.filename, self.desc)
@@ -212,8 +211,7 @@  class lock(object):
             # use empty locker to mean "busy for frequent lock/unlock
             # by many processes"
             raise error.LockHeld(errno.EAGAIN,
-                                 encoding.strfromlocal(self.vfs.join(self.f)),
-                                 self.desc, "")
+                                 self.vfs.join(self.f), self.desc, "")
 
     def _readlock(self):
         """read lock and return its value
diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -206,7 +206,7 @@  class statichttprepository(localrepo.loc
         return statichttppeer(self)
 
     def wlock(self, wait=True):
-        raise error.LockUnavailable(0, _('lock not available'), r'lock',
+        raise error.LockUnavailable(0, _('lock not available'), 'lock',
                                     _('cannot lock static-http repository'))
 
     def lock(self, wait=True):