{"action":"closed","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1018","repository_url":"https://api.github.com/repos/mitmproxy/mitmproxy","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1018/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1018/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/1018/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/1018","id":139793466,"number":1018,"title":"Editing cookies on an intercepted response crashes mitmproxy","user":{"login":"jtietema","id":87322,"avatar_url":"https://avatars.githubusercontent.com/u/87322?v=3","gravatar_id":"","url":"https://api.github.com/users/jtietema","html_url":"https://github.com/jtietema","followers_url":"https://api.github.com/users/jtietema/followers","following_url":"https://api.github.com/users/jtietema/following{/other_user}","gists_url":"https://api.github.com/users/jtietema/gists{/gist_id}","starred_url":"https://api.github.com/users/jtietema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtietema/subscriptions","organizations_url":"https://api.github.com/users/jtietema/orgs","repos_url":"https://api.github.com/users/jtietema/repos","events_url":"https://api.github.com/users/jtietema/events{/privacy}","received_events_url":"https://api.github.com/users/jtietema/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/labels/good%20first%20contribution","name":"good first contribution","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-10T05:50:19Z","updated_at":"2016-03-11T12:19:58Z","closed_at":"2016-03-11T12:19:58Z","body":"##### Steps to reproduce the problem:\r\n\r\n1. set an intercept filter\r\n2. trigger a request that matches the filter\r\n3. press 'a' to make the request pass\r\n4. press <tab> to switch to the intercepted response\r\n5. press 'e' to edit the response\r\n6. press 'c' for editing cookies\r\n\r\n##### What is the expected behavior?\r\nIt allows me to modify the cookies\r\n\r\n##### What went wrong?\r\nIt crashes\r\n\r\n##### Any other comments?\r\nI installed through Homebrew, running Mac OS X 10.10.5\r\nMitmproxy version 0.16\r\n\r\n---\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/__init__.py\", line 498, in run\r\n    self.loop.run()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/main_loop.py\", line 278, in run\r\n    self._run()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/main_loop.py\", line 376, in _run\r\n    self.event_loop.run()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/main_loop.py\", line 682, in run\r\n    self._loop()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/main_loop.py\", line 719, in _loop\r\n    self._watch_files[fd]()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/raw_display.py\", line 393, in <lambda>\r\n    event_loop, callback, self.get_available_raw_input())\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/raw_display.py\", line 493, in parse_input\r\n    callback(processed, processed_codes)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/main_loop.py\", line 403, in _update\r\n    self.process_input(keys)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/main_loop.py\", line 503, in process_input\r\n    k = self._topmost_widget.keypress(self.screen_size, k)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/window.py\", line 39, in keypress\r\n    k = super(self.__class__, self).keypress(size, k)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/container.py\", line 1116, in keypress\r\n    return self.footer.keypress((maxcol,),key)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/statusbar.py\", line 126, in keypress\r\n    return self.ab.keypress(*args, **kwargs)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/statusbar.py\", line 81, in keypress\r\n    self.prompt_execute(k)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/statusbar.py\", line 106, in prompt_execute\r\n    msg = p(txt, *args)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/flowview.py\", line 400, in edit\r\n    message\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/__init__.py\", line 557, in view_grideditor\r\n    ge.make_help()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/blinker/base.py\", line 267, in send\r\n    for receiver in self.receivers_for(sender)]\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/__init__.py\", line 298, in sig_push_view_state\r\n    self.loop.draw_screen()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/main_loop.py\", line 578, in draw_screen\r\n    canvas = self._topmost_widget.render(self.screen_size, focus=True)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/widget.py\", line 141, in cached_render\r\n    canv = fn(self, size, focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/container.py\", line 1083, in render\r\n    focus and self.focus_part == 'body')\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/widget.py\", line 141, in cached_render\r\n    canv = fn(self, size, focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/decoration.py\", line 225, in render\r\n    canv = self._original_widget.render(size, focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/widget.py\", line 141, in cached_render\r\n    canv = fn(self, size, focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/widget.py\", line 1751, in render\r\n    canv = get_delegate(self).render(size, focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/widget.py\", line 141, in cached_render\r\n    canv = fn(self, size, focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/container.py\", line 1083, in render\r\n    focus and self.focus_part == 'body')\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/widget.py\", line 141, in cached_render\r\n    canv = fn(self, size, focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/listbox.py\", line 457, in render\r\n    (maxcol, maxrow), focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/listbox.py\", line 339, in calculate_visible\r\n    self._set_focus_complete( (maxcol, maxrow), focus )\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/listbox.py\", line 704, in _set_focus_complete\r\n    (maxcol,maxrow), focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/listbox.py\", line 674, in _set_focus_first_selectable\r\n    (maxcol, maxrow), focus=focus)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/vendor/lib/python2.7/site-packages/urwid/listbox.py\", line 342, in calculate_visible\r\n    focus_widget, focus_pos = self.body.get_focus()\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/grideditor.py\", line 297, in get_focus\r\n    self.lst[self.focus]\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/grideditor.py\", line 144, in __init__\r\n    w = self.editor.columns[i].text(v)\r\n  File \"/usr/local/Cellar/mitmproxy/0.16/libexec/lib/python2.7/site-packages/libmproxy/console/grideditor.py\", line 72, in text\r\n    p = http_cookies._format_pairs(obj, sep=\"\\n\")\r\nNameError: global name 'http_cookies' is not defined\r\n\r\nmitmproxy has crashed!\r\nPlease lodge a bug report at:\r\n\thttps://github.com/mitmproxy/mitmproxy\r\nShutting down...\r\n```"}}