# HG changeset patch # User Matt Harbison # Date 2019-02-05 21:16:14 # Node ID 765a608c210849861c0479e52d9ec5a5fb34917a # Parent ccaa52865fac446c3f14a7db3b4b12a88eba18cb wsgiheaders: make sure __repr__() returns a string When printing `req.headers` on the server side to debug, it complained that '%b' needed to take a string, not bytes. Changing '%s' to '%r' caused it to complain that __repr__ didn't return a string. diff --git a/mercurial/hgweb/wsgiheaders.py b/mercurial/hgweb/wsgiheaders.py --- a/mercurial/hgweb/wsgiheaders.py +++ b/mercurial/hgweb/wsgiheaders.py @@ -127,7 +127,7 @@ class Headers(object): return self._headers[:] def __repr__(self): - return "%s(%r)" % (self.__class__.__name__, self._headers) + return r"%s(%r)" % (self.__class__.__name__, self._headers) def __str__(self): """str() returns the formatted headers, complete with end line,