Patchwork [3,of,6] py3: convert server-string to unicode to make http library happy

login
register
mail settings
Submitter Yuya Nishihara
Date July 8, 2018, 12:30 p.m.
Message ID <b263133eeb5a5db11706.1531053044@mimosa>
Download mbox | patch
Permalink /patch/32689/
State Accepted
Headers show

Comments

Yuya Nishihara - July 8, 2018, 12:30 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1531036521 -32400
#      Sun Jul 08 16:55:21 2018 +0900
# Node ID b263133eeb5a5db11706fd146ea68ea7ce6ca632
# Parent  e46c3b6a47b5178db472fdc9bb2ce6b56c6322e3
py3: convert server-string to unicode to make http library happy

Patch

diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py
+++ b/mercurial/hgweb/server.py
@@ -246,7 +246,7 @@  class _httprequesthandler(httpservermod.
 
     def version_string(self):
         if self.server.serverheader:
-            return self.server.serverheader
+            return encoding.strfromlocal(self.server.serverheader)
         return httpservermod.basehttprequesthandler.version_string(self)
 
 class _httprequesthandlerssl(_httprequesthandler):