Properly check for UTF8 console
See original GitHub issueSteps to reproduce the problem:
mitmproxy
andmitmproxy --save-stream-file +/tmp/mitmdump
- select some event, enter
- scroll down
Traceback (most recent call last):
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/mitmproxy/tools/console/master.py", line 216, in run
self.loop.run()
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 286, in run
self._run()
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 384, in _run
self.event_loop.run()
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 788, in run
self._loop()
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 816, in _loop
self._entering_idle()
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 777, in _entering_idle
callback()
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 572, in entering_idle
self.draw_screen()
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 586, in draw_screen
canvas = self._topmost_widget.render(self.screen_size, focus=True)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/container.py", line 1086, in render
focus and self.focus_part == 'body')
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/decoration.py", line 226, in render
canv = self._original_widget.render(size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/container.py", line 1086, in render
focus and self.focus_part == 'body')
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/container.py", line 1086, in render
focus and self.focus_part == 'body')
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 1765, in render
canv = get_delegate(self).render(size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/container.py", line 1086, in render
focus and self.focus_part == 'body')
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/listbox.py", line 489, in render
focus_canvas = focus_widget.render((maxcol,), focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 144, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/widget.py", line 1004, in render
return apply_text_layout(text, attr, trans, maxcol)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/canvas.py", line 1315, in apply_text_layout
return TextCanvas(t, a, c, maxcol=maxcol)
File "/usr/local/Cellar/mitmproxy/3.0.0/libexec/lib/python3.6/site-packages/urwid/canvas.py", line 358, in __init__
raise CanvasError("Canvas text is wider than the maxcol specified \n%r\n%r\n%r"%(maxcol,widths,text))
urwid.canvas.CanvasError: Canvas text is wider than the maxcol specified
153
[153, 153, 154, 125]
[b'[REDACTED NAME]: ....$.......?.E=?[LONG REDACTED GLIBBERISH]"]
System information
$ mitmproxy --version
Mitmproxy: 3.0.0
Python: 3.6.4
OpenSSL: OpenSSL 1.0.2n 7 Dec 2017
Platform: Darwin-13.4.0-x86_64-i386-64bit
(via Brew, installed earlier today, so should be the latest version)
From the second run with dumping to file, this seems to be the binary form-data where it crashed. The request is to an API’s upload function.
2018-02-23 08:00:00
--Boundary+1DAA87079F6BACB5
Content-Disposition: form-data; name="[REDACTED NAME]"; filename="file"
Content-Type: application/octet-stream
^A^@^@^@[REDACTED GLIBBERISH]
As I am not certain about the contents of the recorded data, so I won’t post the dump public. However, I have keep it for now.
Also might be another occurrence of #1796.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Properly print utf8 characters in windows console
UTF-8 text can be printed directly to the console by setting the console output codepage to CP_UTF8, ... To check the UTF-8 support,...
Read more >Unicode and UTF-8 Output Text Buffer - Windows Command ...
Windows Command-Line: Unicode and UTF-8 Output Text Buffer ... and measure the Console's performance, memory footprint, power consumption, ...
Read more >Unicode characters are not appearing properly in console and ...
For console-related issues first set the encoding type in the Web Browser (in Internet Explorer: View->Encoding->UTF-8). If inputting data in ...
Read more >Is there a Linux command to find out if a file is UTF-8?
You can determine the file encoding with the following command: file -bi filename ... You can verify if a file happens to pass...
Read more >UTF-8 characters are not printed correctly on the console
I found a solution! I simply had to convert the files to UTF-8 , they where in ISO-8859 . To see the file's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
mitmproxy --version
locale -a
tput cols
Thanks for the instructions - I was able to replicate it. @mhils I can take a look at this