Mercurial > public > mercurial-scm > hg
comparison mercurial/windows.py @ 34022:d5b2beca16c0
python3: wrap all uses of <exception>.strerror with strtolocal
Our string literals are bytes, and we mostly want to %-format a
strerror into a one of those literals, so this fixes a ton of issues.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Tue, 22 Aug 2017 20:03:07 -0400 |
parents | 8cb9e921ef8c |
children | 0fa781320203 |
comparison
equal
deleted
inserted
replaced
34021:31a2eb0f74e5 | 34022:d5b2beca16c0 |
---|---|
135 return mixedfilemodewrapper(fp) | 135 return mixedfilemodewrapper(fp) |
136 | 136 |
137 return fp | 137 return fp |
138 except WindowsError as err: | 138 except WindowsError as err: |
139 # convert to a friendlier exception | 139 # convert to a friendlier exception |
140 raise IOError(err.errno, '%s: %s' % (name, err.strerror)) | 140 raise IOError(err.errno, '%s: %s' % ( |
141 name, encoding.strtolocal(err.strerror))) | |
141 | 142 |
142 # may be wrapped by win32mbcs extension | 143 # may be wrapped by win32mbcs extension |
143 listdir = osutil.listdir | 144 listdir = osutil.listdir |
144 | 145 |
145 class winstdout(object): | 146 class winstdout(object): |