Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
34039:31a2eb0f74e5 | 34040:d5b2beca16c0 |
---|---|
287 try: | 287 try: |
288 # ensure caller gets private copy of ui | 288 # ensure caller gets private copy of ui |
289 repo = hg.repository(self.ui.copy(), real) | 289 repo = hg.repository(self.ui.copy(), real) |
290 return hgweb_mod.hgweb(repo).run_wsgi(req) | 290 return hgweb_mod.hgweb(repo).run_wsgi(req) |
291 except IOError as inst: | 291 except IOError as inst: |
292 msg = inst.strerror | 292 msg = encoding.strtolocal(inst.strerror) |
293 raise ErrorResponse(HTTP_SERVER_ERROR, msg) | 293 raise ErrorResponse(HTTP_SERVER_ERROR, msg) |
294 except error.RepoError as inst: | 294 except error.RepoError as inst: |
295 raise ErrorResponse(HTTP_SERVER_ERROR, str(inst)) | 295 raise ErrorResponse(HTTP_SERVER_ERROR, str(inst)) |
296 | 296 |
297 # browse subdirectories | 297 # browse subdirectories |