--- a/mercurial/hgweb/request.py Mon Aug 07 11:05:43 2023 +0200
+++ b/mercurial/hgweb/request.py Mon Aug 07 23:12:02 2023 +0200
@@ -11,7 +11,6 @@
from ..thirdparty import attr
from .. import (
- encoding,
error,
pycompat,
util,
@@ -167,13 +166,7 @@
def tobytes(s):
if not isinstance(s, str):
return s
- if pycompat.iswindows:
- # This is what mercurial.encoding does for os.environ on
- # Windows.
- return encoding.strtolocal(s)
- else:
- # This is what is documented to be used for os.environ on Unix.
- return pycompat.fsencode(s)
+ return s.encode('iso8859-1')
env = {tobytes(k): tobytes(v) for k, v in env.items()}