Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgwebdir_mod.py @ 34040: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 | c8f212cb0c83 |
children | 0fa781320203 |
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py Wed Aug 30 14:04:55 2017 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Tue Aug 22 20:03:07 2017 -0400 @@ -289,7 +289,7 @@ repo = hg.repository(self.ui.copy(), real) return hgweb_mod.hgweb(repo).run_wsgi(req) except IOError as inst: - msg = inst.strerror + msg = encoding.strtolocal(inst.strerror) raise ErrorResponse(HTTP_SERVER_ERROR, msg) except error.RepoError as inst: raise ErrorResponse(HTTP_SERVER_ERROR, str(inst))