diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -164,8 +164,8 @@ def posixfile(name, mode='r', buffering= return fp except WindowsError as err: # convert to a friendlier exception - raise IOError(err.errno, '%s: %s' % ( - name, encoding.strtolocal(err.strerror))) + raise IOError(err.errno, r'%s: %s' % ( + encoding.strfromlocal(name), err.strerror)) # may be wrapped by win32mbcs extension listdir = osutil.listdir @@ -201,7 +201,7 @@ class winstdout(object): if inst.errno != 0 and not win32.lasterrorwaspipeerror(inst): raise self.close() - raise IOError(errno.EPIPE, 'Broken pipe') + raise IOError(errno.EPIPE, r'Broken pipe') def flush(self): try: @@ -209,7 +209,7 @@ class winstdout(object): except IOError as inst: if not win32.lasterrorwaspipeerror(inst): raise - raise IOError(errno.EPIPE, 'Broken pipe') + raise IOError(errno.EPIPE, r'Broken pipe') def _is_win_9x(): '''return true if run on windows 95, 98 or me.''' @@ -616,4 +616,4 @@ def readpipe(pipe): return ''.join(chunks) def bindunixsocket(sock, path): - raise NotImplementedError('unsupported platform') + raise NotImplementedError(r'unsupported platform')