wsgiheaders: make sure __repr__() returns a string
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 05 Feb 2019 16:16:14 -0500
changeset 41588 765a608c2108
parent 41587 ccaa52865fac
child 41589 46432c04f010
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.
mercurial/hgweb/wsgiheaders.py
--- a/mercurial/hgweb/wsgiheaders.py	Tue Feb 05 13:32:39 2019 -0500
+++ b/mercurial/hgweb/wsgiheaders.py	Tue Feb 05 16:16:14 2019 -0500
@@ -127,7 +127,7 @@
         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,