# HG changeset patch # User Gregory Szorc # Date 1538460667 25200 # Node ID 36e9d2c6083746250941995aee606b347b188847 # Parent c421c22d3ad28ea13b2973d238ff03df2622a1e7 py3: use system strings for HTTP response header comparison res.headers is holding system strings. Attempting to compare against bytes always fails and we fail to print decoded CBOR responses on Python 3. After this change, various test-wireproto* tests are now properly printing CBOR response objects. Differential Revision: https://phab.mercurial-scm.org/D4835 diff -r c421c22d3ad2 -r 36e9d2c60837 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Mon Oct 01 23:08:04 2018 -0700 +++ b/mercurial/debugcommands.py Mon Oct 01 23:11:07 2018 -0700 @@ -3324,7 +3324,8 @@ getattr(e, 'read', lambda: None)() continue - if res.headers.get('Content-Type') == 'application/mercurial-cbor': + ct = res.headers.get(r'Content-Type') + if ct == r'application/mercurial-cbor': ui.write(_('cbor> %s\n') % stringutil.pprint(cborutil.decodeall(body)[0], bprefix=True,