Repository: mitmproxy/mitmproxy

Issue:
ValueError: data must be bytes, but is str
Hi , 
    When i use 'e' to edit form , sometimes  i get this .

```
➜  ~ mitmproxy -b 192.168.1.2 -p 8080
Traceback (most recent call last):
  File "mitmproxy/tools/console/master.py", line 292, in run
  File "site-packages/urwid/main_loop.py", line 278, in run
  File "site-packages/urwid/main_loop.py", line 376, in _run
  File "site-packages/urwid/main_loop.py", line 682, in run
  File "site-packages/urwid/main_loop.py", line 719, in _loop
  File "site-packages/urwid/raw_display.py", line 393, in <lambda>
  File "site-packages/urwid/raw_display.py", line 493, in parse_input
  File "site-packages/urwid/main_loop.py", line 403, in _update
  File "site-packages/urwid/main_loop.py", line 503, in process_input
  File "mitmproxy/tools/console/window.py", line 84, in keypress
  File "site-packages/urwid/container.py", line 1116, in keypress
  File "mitmproxy/tools/console/statusbar.py", line 155, in keypress
  File "mitmproxy/tools/console/statusbar.py", line 108, in keypress
  File "mitmproxy/tools/console/statusbar.py", line 133, in prompt_execute
  File "mitmproxy/tools/console/statusbar.py", line 31, in __call__
  File "mitmproxy/tools/console/flowview.py", line 415, in edit
  File "mitmproxy/tools/console/flowview.py", line 351, in edit_form
  File "mitmproxy/tools/console/master.py", line 352, in view_grideditor
  File "site-packages/blinker/base.py", line 267, in send
  File "site-packages/blinker/base.py", line 267, in <listcomp>
  File "mitmproxy/tools/console/master.py", line 144, in sig_push_view_state
  File "site-packages/urwid/main_loop.py", line 578, in draw_screen
  File "site-packages/urwid/widget.py", line 141, in cached_render
  File "site-packages/urwid/container.py", line 1083, in render
  File "site-packages/urwid/widget.py", line 141, in cached_render
  File "site-packages/urwid/decoration.py", line 225, in render
  File "site-packages/urwid/widget.py", line 141, in cached_render
  File "site-packages/urwid/widget.py", line 1750, in render
  File "site-packages/urwid/widget.py", line 141, in cached_render
  File "site-packages/urwid/container.py", line 1083, in render
  File "site-packages/urwid/widget.py", line 141, in cached_render
  File "site-packages/urwid/listbox.py", line 455, in render
  File "site-packages/urwid/listbox.py", line 337, in calculate_visible
  File "site-packages/urwid/listbox.py", line 702, in _set_focus_complete
  File "site-packages/urwid/listbox.py", line 672, in _set_focus_first_selectable
  File "site-packages/urwid/listbox.py", line 340, in calculate_visible
  File "mitmproxy/tools/console/grideditor/base.py", line 223, in get_focus
  File "mitmproxy/tools/console/grideditor/base.py", line 77, in __init__
  File "mitmproxy/tools/console/grideditor/col_bytes.py", line 33, in Display
  File "mitmproxy/tools/console/grideditor/col_bytes.py", line 73, in __init__
  File "mitmproxy/utils/strutils.py", line 72, in bytes_to_escaped_str
ValueError: data must be bytes, but is str

mitmproxy has crashed!
Please lodge a bug report at:
	https://github.com/mitmproxy/mitmproxy
Shutting down...

```
systeminfo:
Mitmproxy version: 1.0.0
Python version: 3.5.2
Platform: Darwin-15.6.0-x86_64-i386-64bit
SSL version: OpenSSL 1.0.2j  26 Sep 2016
Mac version: 10.11.6 ('', '', '') x86_64



Discussion:

Resolving patch:
diff --git a/mitmproxy/tools/console/grideditor/editors.py b/mitmproxy/tools/console/grideditor/editors.py
--- a/mitmproxy/tools/console/grideditor/editors.py
+++ b/mitmproxy/tools/console/grideditor/editors.py
@@ -65,8 +65,8 @@ def handle_key(self, key):
 class URLEncodedFormEditor(base.GridEditor):
     title = "Editing URL-encoded form"
     columns = [
-        col_bytes.Column("Key"),
-        col_bytes.Column("Value")
+        col_text.Column("Key"),
+        col_text.Column("Value")
     ]
 
 


Test patch: