diff options
author | Shadab Zafar <dufferzafar0@gmail.com> | 2016-07-09 12:43:21 +0530 |
---|---|---|
committer | Shadab Zafar <dufferzafar0@gmail.com> | 2016-07-09 12:43:21 +0530 |
commit | 0a21d270046f97a8d7da4378ca3a54b4a7f898b8 (patch) | |
tree | 38bd0abb2d70be566ae9f5eca01f4134c8319b4a | |
parent | c7cbbf5f0de9bceccc37b73586ed3baf9421f63a (diff) | |
download | mitmproxy-0a21d270046f97a8d7da4378ca3a54b4a7f898b8.tar.gz mitmproxy-0a21d270046f97a8d7da4378ca3a54b4a7f898b8.tar.bz2 mitmproxy-0a21d270046f97a8d7da4378ca3a54b4a7f898b8.zip |
strutils.hexdump returns native_strings
-rw-r--r-- | mitmproxy/contentviews.py | 2 | ||||
-rw-r--r-- | netlib/strutils.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/contentviews.py b/mitmproxy/contentviews.py index 706fa5ed..331a706f 100644 --- a/mitmproxy/contentviews.py +++ b/mitmproxy/contentviews.py @@ -172,7 +172,7 @@ class ViewHex(View): def _format(data): for offset, hexa, s in strutils.hexdump(data): yield [ - ("offset", offset + b" "), + ("offset", offset + " "), ("text", hexa + " "), ("text", s) ] diff --git a/netlib/strutils.py b/netlib/strutils.py index 9208f954..a51df886 100644 --- a/netlib/strutils.py +++ b/netlib/strutils.py @@ -146,7 +146,7 @@ def hexdump(s): A generator of (offset, hex, str) tuples """ for i in range(0, len(s), 16): - offset = "{:0=10x}".format(i).encode() + offset = "{:0=10x}".format(i) part = s[i:i + 16] x = " ".join("{:0=2x}".format(i) for i in six.iterbytes(part)) x = x.ljust(47) # 16*2 + 15 |