D1135: webutil: use pycompat.bytestr() instead of str()
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Tue Oct 17 02:56:16 UTC 2017
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Stops us from choking the templater on Python 3. With this patch
applied, much of hgweb works correctly in Python 3. The notable
exception is the graph page, which chokes because it gets node IDs as
str instead of bytes.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1135
AFFECTED FILES
mercurial/hgweb/webutil.py
CHANGE DETAILS
diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -30,6 +30,7 @@
mdiff,
patch,
pathutil,
+ pycompat,
templatefilters,
ui as uimod,
util,
@@ -589,7 +590,10 @@
def __iter__(self):
separator = self.start
for key, value in sorted(self.vars.iteritems()):
- yield {'name': key, 'value': str(value), 'separator': separator}
+ yield {'name': key,
+ 'value': pycompat.bytestr(value),
+ 'separator': separator,
+ }
separator = '&'
class wsgiui(uimod.ui):
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list