diff -r 46c97973ee46 -r af0a19d8812b mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Sat Feb 17 01:09:56 2018 -0500 +++ b/mercurial/hgweb/webutil.py Sat Feb 17 01:11:48 2018 -0500 @@ -347,7 +347,7 @@ try: return util.processlinerange(fromline, toline) except error.ParseError as exc: - raise ErrorResponse(HTTP_BAD_REQUEST, str(exc)) + raise ErrorResponse(HTTP_BAD_REQUEST, pycompat.bytestr(exc)) def formatlinerange(fromline, toline): return '%d:%d' % (fromline + 1, toline)