Open vnc2017 opened 3 years ago
I already had a problem similar to this one, this means that you have a long file name with non-latin characters inside the directory, and the width I calculate is wrong.
Can you paste here the name of the file that makes rnr crash, please?
If you're not sure which one is the file that makes rnr crash, you can create a temporary directory, and copy one file at a time inside the temporary directory, and then try to start rnr from that temporary directory, until you find the file that makes rnr crash.
The above errors was on my home directory. I created a directory in /tmp called test and created a blank file called hello.txt
with file inside the directory or without it the errors are same.
10:26 /tmp/test $ ll total 0 -rw-r--r-- 1 drebb drebb 0 May 26 10:24 hello.txt
10:26 /tmp/test
$ rnr
Traceback (most recent call last):
File "/home/drebb/.local/bin/rnr", line 10, in
--:-- /tmp/test
This problem is harder than I imagined, if it's not related to the file names, then I don't know what it is. From the error it looks like urwid wrongly calculates a width of 3 for the box drawing character U+2500 (b'\xe2\x94\x80' is U+2500 encoded in UTF-8).
My suspicion now is that you don't have utf-8 as the default character encoding. Can you paste me the output of the command:
python3 -c 'import sys; print(sys.getdefaultencoding())'
Also, try running rnr with this command:
env LC_ALL=it_IT.UTF-8 rnr
and tell me if it works.
18:30 /tmp/test $ python3 -c 'import sys; print(sys.getdefaultencoding())' utf-8
18:30 /tmp/test
$ env LC_ALL=it_IT.UTF-8 rnr
Traceback (most recent call last):
File "/home/drebb/.local/bin/rnr", line 10, in
--:-- /tmp/test $
I don't get it, you have utf-8 as the default encoding (as it should be), and treating that string as utf-8 gives a width of 1, not 3. I have no idea of why this happens.
I'm suspecting that this has something to do with your specific customizations, I don't know if you have customized Python3 in some way (for example setting PYTHONPATH or similar environment variables, or you're using a sitecustomize.py file or similar).
I cannot reproduce your problem, so I'm afraid I cannot help you.
no problem @bugnano. I have not done any changes to PYTHONPATH or sitecustomize.py. Thanks for troubleshooting.
Hi,
I tried installing on my system and below errors came up and I am not sure whats the cause of it. Appreciate the help!.
Operating System: Debian GNU/Linux 10 (buster) - 10.9 Kernel: Linux 4.19.0-16-amd64 Architecture: x86-64
$ pip3 install --user --upgrade rnr Requirement already up-to-date: rnr in ./.local/lib/python3.7/site-packages (1.0.5) Requirement already satisfied, skipping upgrade: pyxdg in /usr/lib/python3/dist-packages (from rnr) (0.25) Requirement already satisfied, skipping upgrade: Pygments in ./.local/lib/python3.7/site-packages (from rnr) (2.9.0) Requirement already satisfied, skipping upgrade: urwid in ./.local/lib/python3.7/site-packages (from rnr) (2.1.2) Requirement already satisfied, skipping upgrade: atomicwrites in ./.local/lib/python3.7/site-packages (from rnr) (1.4.0) Requirement already satisfied, skipping upgrade: fuzzyfinder in ./.local/lib/python3.7/site-packages (from rnr) (2.1.0)
09:24 ~ $ rnr Traceback (most recent call last): File "/home/drebb/.local/bin/rnr", line 10, in
sys.exit(main())
File "/home/drebb/.local/lib/python3.7/site-packages/rnr/main.py", line 1065, in main
app.run()
File "/home/drebb/.local/lib/python3.7/site-packages/rnr/main.py", line 246, in run
self.loop.run()
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/main_loop.py", line 287, in run
self._run()
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/main_loop.py", line 385, in _run
self.event_loop.run()
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/main_loop.py", line 790, in run
self._loop()
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/main_loop.py", line 818, in _loop
self._entering_idle()
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/main_loop.py", line 779, in _entering_idle
callback()
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/main_loop.py", line 574, in entering_idle
self.draw_screen()
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/main_loop.py", line 588, in draw_screen
canvas = self._topmost_widget.render(self.screen_size, focus=True)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 1761, in render
canv = get_delegate(self).render(size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/container.py", line 1565, in render
canv = w.render((maxcol, rows), focus=focus and item_focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/container.py", line 2131, in render
focus = focus and self.focus_position == i)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 1761, in render
canv = get_delegate(self).render(size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/container.py", line 1559, in render
canv = w.render((maxcol,), focus=focus and item_focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/decoration.py", line 226, in render
canv = self._original_widget.render(size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 1761, in render
canv = get_delegate(self).render(size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/container.py", line 2131, in render
focus = focus and self.focus_position == i)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/container.py", line 2131, in render
focus = focus and self.focus_position == i)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/decoration.py", line 226, in render
canv = self._original_widget.render(size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/widget.py", line 1005, in render
return apply_text_layout(text, attr, trans, maxcol)
File "/home/drebb/.local/lib/python3.7/site-packages/urwid/canvas.py", line 1315, in apply_text_layout
return TextCanvas(t, a, c, maxcol=maxcol)
File "/home/drebb/.local/lib/python3.7/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
1
[3]
[b'\xe2\x94\x80']