bugranger - Bugs: bug #35507, ranger crashes when entering...

 
 

bug #35507: ranger crashes when entering non-ascii directories

Submitted by:  None
Submitted on:  Sat 11 Feb 2012 10:45:50 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 06 Apr 2012 09:34:20 PM UTC, comment #5:

I had the same problem when using version 1.5.3 so I updated to the git version and the bug seems to be fixed.
Thanks! :)

Anonymous
Wed 14 Mar 2012 03:25:19 PM UTC, comment #4:

I pushed a fix, can you upgrade and confirm that it works now?

Roman Z. <hut>
Project Administrator
Wed 15 Feb 2012 09:46:11 PM UTC, comment #3:

Okay, I will investigate that.

Roman Z. <hut>
Project Administrator
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!)

Anonymous
Sat 11 Feb 2012 02:04:52 PM UTC, comment #1:

Hi, I can enter any directories, even if they have corrupted names. Are you using the newest version of ranger?

Roman Z. <hut>
Project Administrator
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()

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hut (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 14 Dec 2012 10:43:22 AM UTChutStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Wed 15 Feb 2012 09:46:11 PM UTChutStatusWorks For Me=>In Progress
    Sat 11 Feb 2012 02:05:08 PM UTChutStatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1