tweekmonster / tmux2html

:cat2: Render full tmux windows or individual panes as HTML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnicodeDecodeError: 'utf-8' codec can't decode byte

faxm0dem opened this issue · comments

I stumbled upon this while running on CentOS7:

(virtualenv) $ tmux2html 0 -o out.html --interval 0.2 --stream
Streaming (0.20s) to 20200204-qserv-install.html.
Press Ctrl-C to stop.
Traceback (most recent call last):
  File "/home/fwernli/virtualenv/bin/tmux2html", line 8, in <module>
    sys.exit(main())
  File "/home/fwernli/virtualenv/lib/python3.6/site-packages/tmux2html/main.py", line 735, in main
    output = r.render_pane(target_pane, script_reload=args.interval)
  File "/home/fwernli/virtualenv/lib/python3.6/site-packages/tmux2html/main.py", line 479, in render_pane
    self._render_pane(pane, full=full, max_lines=max_lines)
  File "/home/fwernli/virtualenv/lib/python3.6/site-packages/tmux2html/main.py", line 457, in _render_pane
    self._render_pane(p, empty, full=full, max_lines=max_lines)
  File "/home/fwernli/virtualenv/lib/python3.6/site-packages/tmux2html/main.py", line 457, in _render_pane
    self._render_pane(p, empty, full=full, max_lines=max_lines)
  File "/home/fwernli/virtualenv/lib/python3.6/site-packages/tmux2html/main.py", line 467, in _render_pane
    full=full, max_lines=max_lines),
  File "/home/fwernli/virtualenv/lib/python3.6/site-packages/tmux2html/utils.py", line 69, in get_contents
    ] + args, ignore_error=True)
  File "/home/fwernli/virtualenv/lib/python3.6/site-packages/tmux2html/utils.py", line 35, in shell_cmd
    return stdout.decode('utf8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 153: invalid start byte
(virtualenv) $ echo $LANG
en_US.UTF-8

For the record, this happens when recording the serial console of Dell servers while updating their BIOS config