diff mercurial/hgweb/common.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 62f9679df1f2
children 67873ec0f4ce
line wrap: on
line diff
--- a/mercurial/hgweb/common.py	Wed Aug 30 14:04:55 2017 -0700
+++ b/mercurial/hgweb/common.py	Tue Aug 22 20:03:07 2017 -0400
@@ -178,7 +178,8 @@
         if err.errno == errno.ENOENT:
             raise ErrorResponse(HTTP_NOT_FOUND)
         else:
-            raise ErrorResponse(HTTP_SERVER_ERROR, err.strerror)
+            raise ErrorResponse(HTTP_SERVER_ERROR,
+                                encoding.strtolocal(err.strerror))
 
 def paritygen(stripecount, offset=0):
     """count parity of horizontal stripes for easier reading"""