# HG changeset patch # User Matt Harbison # Date 1538011518 14400 # Node ID 2209e72f9fcb268cde986a64a0447c56d612ca5c # Parent c841e8855cd31690125e6b60b1d31dd7385fd859 py3: ensure standard exceptions use `str` type strings in windows.py See also edaa40dc5fe5. diff -r c841e8855cd3 -r 2209e72f9fcb mercurial/windows.py --- a/mercurial/windows.py Wed Sep 26 20:49:28 2018 -0400 +++ b/mercurial/windows.py Wed Sep 26 21:25:18 2018 -0400 @@ -164,8 +164,8 @@ 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 @@ 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 @@ 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 @@ return ''.join(chunks) def bindunixsocket(sock, path): - raise NotImplementedError('unsupported platform') + raise NotImplementedError(r'unsupported platform')