Encounter "urwid.canvas.CanvasError: Canvas text is wider than the maxcol specified"

Bug #1806841 reported by Ray Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bugit
Fix Released
Medium
Unassigned

Bug Description

Was using copy and paste from summary to another field and encountered qabro unexpected exit and got traceback as below

=========

u@u-HP-EliteDesk-800-G4-DM:~$ qabro
Traceback (most recent call last):
  File "/snap/qabro/55/bin/qabro", line 11, in <module>
    load_entry_point('qabro==0.8', 'console_scripts', 'qabro')()
  File "/snap/qabro/55/lib/python3.5/site-packages/qabro/__init__.py", line 55, in main
    start_ui()
  File "/snap/qabro/55/lib/python3.5/site-packages/qabro/__init__.py", line 60, in start_ui
    ui.run()
  File "/snap/qabro/55/lib/python3.5/site-packages/qabro/ui.py", line 109, in run
    self.loop.run()
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/main_loop.py", line 286, in run
    self._run()
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/main_loop.py", line 384, in _run
    self.event_loop.run()
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/main_loop.py", line 788, in run
    self._loop()
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/main_loop.py", line 816, in _loop
    self._entering_idle()
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/main_loop.py", line 777, in _entering_idle
    callback()
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/main_loop.py", line 572, in entering_idle
    self.draw_screen()
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/main_loop.py", line 586, in draw_screen
    canvas = self._topmost_widget.render(self.screen_size, focus=True)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/container.py", line 1086, in render
    focus and self.focus_part == 'body')
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/decoration.py", line 817, in render
    canv = self._original_widget.render((maxcol,), focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/container.py", line 1523, in render
    canv = w.render((maxcol,), focus=focus and item_focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 1765, in render
    canv = get_delegate(self).render(size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/container.py", line 1523, in render
    canv = w.render((maxcol,), focus=focus and item_focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/container.py", line 2087, in render
    focus = focus and self.focus_position == i)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 1634, in render
    canv = Text.render(self,(maxcol,))
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 144, in cached_render
    canv = fn(self, size, focus=focus)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/widget.py", line 1004, in render
    return apply_text_layout(text, attr, trans, maxcol)
  File "/snap/qabro/55/lib/python3.5/site-packages/urwid/canvas.py", line 1315, in apply_text_layout
    return TextCanvas(t, a, c, maxcol=maxcol)
  File "/snap/qabro/55/lib/python3.5/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
96
[8, 93, 5, 19, 52, 16, 47, 14, 98, 4, 13]
[b'Summary: ', b"[cmit] Audio input not work, System can detected the 3 ring earphone plugged but doesn't have ", b'input ', b'Steps to reproduce: ', b'1. Plug 3 ring earphone with mic to appropriate jack ', b'Expected result: ', b'System can be recording audio from external mic ', b'Actual result: ', b"Audio input not work, System can detected the 3 ring earphone plugged but doesn't have ???put ", b' ', b'Failure rate:']

Related branches

Pierre Equoy (pieq)
Changed in qabro:
milestone: none → 0.9
importance: Undecided → Medium
Revision history for this message
Pierre Equoy (pieq) wrote :

The issue happens because you've tried to paste unicode characters (in that case, the "┌───" characters that surrounds the different text fields).

I've tested the following:

1. Launch qabro
2. Try to paste a Unicode character (for instance "好")

With the snap version of qabro, it prints "???", but when I test qabro outside of snap, it works.

I investigated a bit and found that urwid (the library qabro uses to handle the user interface) checks the locale to see if it can use Unicode. Apparently, from within the snap, it fails (urwid returns `narrow` instead of `utf8`).

I need to find a way to fix this.

Changed in qabro:
status: New → Triaged
Pierre Equoy (pieq)
Changed in qabro:
status: Triaged → Fix Committed
Pierre Equoy (pieq)
Changed in qabro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.