Tue 14 Feb 2012 04:28:19 PM UTC, comment #2:
Hi,
sorry for the late reply, I’ve been fooled by the top-posting layout and missed your message.
I’m using the Git version that I pulled on Friday, 2012-02-11. I’m running Ranger in UXterm in Ubuntu 11.10. A co-worker has just experienced the exact same problem with UXterm.
(I’m spreading Ranger like hell in my office! Keep up the great work!)
|
Sat 11 Feb 2012 10:45:50 AM UTC, original submission:
Ranger wors fine in my home directory:
/home
/kaze
/Applications
/Documents
/Musique
/Téléchargements
/Vidéos
But it crashes when entering non-ascii dirs, e.g. "Téléchargements" (= downloads):
$ ~/Applications/src/ranger-git/ranger.py
ranger version: 1.5.2, executed with python 2.7.2+
Locale: fr_FR.UTF-8
Current file: /home/kaze/Téléchargements/chatzilla
Traceback (most recent call last):
File "/home/kaze/Applications/src/ranger-git/ranger/core/main.py", line 132, in main
fm.loop()
File "/home/kaze/Applications/src/ranger-git/ranger/core/fm.py", line 191, in loop
ui.redraw()
File "/home/kaze/Applications/src/ranger-git/ranger/gui/ui.py", line 261, in redraw
self.draw()
File "/home/kaze/Applications/src/ranger-git/ranger/gui/ui.py", line 296, in draw
fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
ranger crashed. Please report this traceback at:
http://savannah.nongnu.org/bugs/?group=ranger&func=additem
Here’s the dirty workaround I’m using for now — I’m afraid I don’t know Python so I can’t help much:
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index 5599190..e2cbaff 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -293,8 +293,7 @@ class UI(DisplayableContainer):
split = cwd.rsplit(os.sep, self.settings.shorten_title)
if os.sep in split[0]:
cwd = os.sep.join(split[1:])
- fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \
- decode('utf-8', 'replace')
+ fixed_cwd = cwd
sys.stdout.write("\033]2;ranger:" + fixed_cwd + "\007")
sys.stdout.flush()
self.win.refresh()
|