bugranger - Bugs: bug #30311, Crash due to multibyte filenames

 
 

bug #30311: Crash due to multibyte filenames

Submitted by:  None
Submitted on:  Thu 01 Jul 2010 10:04:36 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Privacy: PublicAssigned to: Roman Z. <hut>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Wed 13 Oct 2010 12:19:16 AM UTC, comment #10:

Thanks you, it works great !!

Anonymous
Wed 13 Oct 2010 12:18:54 AM UTC, comment #9:

Thanks you, it works great !!

Anonymous
Tue 12 Oct 2010 11:41:56 PM UTC, comment #8:

There we go. This bug should never occur anymore.

Previews for zip files are generated in a different way that won't throw this error.

Roman Z. <hut>
Project AdministratorIn charge of this item.
Thu 30 Sep 2010 03:05:58 AM UTC, comment #7:

The fix had side-effects, so I reverted it for now and moved it to a separate branch "utf".
When every issue is settled, I'll merge it back into "master".

Roman Z. <hut>
Project AdministratorIn charge of this item.
Wed 29 Sep 2010 11:14:53 PM UTC, comment #6:

This bug should be fixed now. I'd appreciate if you could test the newest git version and see if you can still reproduce the crash.

I'm sorry that it took me so long, but encodings give me a headache.

Roman Z. <hut>
Project AdministratorIn charge of this item.
Tue 31 Aug 2010 05:32:13 AM UTC, comment #5:

I did some experiments, and yes, it seems to be the case you described. Japanese filenames within a zip file crashes Ranger.

Not knowing exactly how this would happen, afaik zip format already has Unicode support.

Fyi, I'm using the Info-zip compressor. ( http://www.info-zip.org/pub/infozip/Zip.html )

b4283 <b4283>
Sat 28 Aug 2010 07:53:17 PM UTC, comment #4:

Could it be that it crashes only when you attempt to preview a zip archive containing japanese filenames?

Roman Z. <hut>
Project AdministratorIn charge of this item.
Fri 30 Jul 2010 02:58:11 AM UTC, comment #3:

I'm sorry to have replied at a tardy time, but I just found another fact that confuses meself: by creating a file with the same filename at another directory, amazingly Ranger stayed alive, I guess this will remain a puzzle...

b4283 <b4283>
Fri 30 Jul 2010 02:49:57 AM UTC, comment #2:

my kind sir, here is the data you requested:

$ python -c 'print(u"\u66b4")'

$ python -c 'print(u"\u66b4".encode("utf8"))'

$ python -c 'import locale; print(locale.setlocale(locale.LC_ALL, ""))'
zh_TW.UTF-8

b4283 <b4283>
Thu 01 Jul 2010 07:59:14 PM UTC, comment #1:

The character u'\u66b4' is 暴. Viewing this character in ranger
causes no problems for me, I can even type it in (with shift+middle click.)

So, I'm afraid I'll have to ask for more details:
What are the outputs of these commands?

1. python -c 'print(u"\u66b4")'
2. python -c 'print(u"\u66b4".encode("utf8"))'
3. python -c 'import locale; print(locale.setlocale(locale.LC_ALL, ""))'

Roman Z. <hut>
Project AdministratorIn charge of this item.
Thu 01 Jul 2010 10:04:36 AM UTC, original submission:

This happens when I browse through a directory full of Japanese filenames. Ranger crashed immediately, and presents the following:

--
Traceback (most recent call last):
File "/usr/share/ranger/ranger/__main__.py", line 211, in main
fm.loop()
File "/usr/share/ranger/ranger/core/fm.py", line 138, in loop
ui.redraw()
File "/usr/share/ranger/ranger/gui/ui.py", line 213, in redraw
self.draw()
File "/usr/share/ranger/ranger/gui/ui.py", line 234, in draw
DisplayableContainer.draw(self)
File "/usr/share/ranger/ranger/gui/displayable.py", line 268, in draw
displayable.draw()
File "/usr/share/ranger/ranger/gui/widgets/browserview.py", line 100, in draw
DisplayableContainer.draw(self)
File "/usr/share/ranger/ranger/gui/displayable.py", line 268, in draw
displayable.draw()
File "/usr/share/ranger/ranger/gui/widgets/browsercolumn.py", line 138, in draw
self._draw_file()
File "/usr/share/ranger/ranger/gui/widgets/browsercolumn.py", line 166, in _draw_file
Pager.draw(self)
File "/usr/share/ranger/ranger/gui/widgets/pager.py", line 74, in draw
self._draw_line(i, line)
File "/usr/share/ranger/ranger/gui/widgets/pager.py", line 79, in _draw_line
self.addstr(i, 0, line)
File "/usr/share/ranger/ranger/gui/curses_shortcuts.py", line 54, in addstr
self.win.addstr(*(ascii_only(obj) for obj in args))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u66b4' in position 0: ordinal not in range(128)

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 b4283 (Posted a comment)
  • -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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 12 Oct 2010 11:42:15 PM UTChutStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Thu 30 Sep 2010 03:05:58 AM UTChutStatusFixed=>In Progress
      Open/ClosedClosed=>Open
    Wed 29 Sep 2010 11:38:52 PM UTChutOpen/ClosedOpen=>Closed
    Wed 29 Sep 2010 11:14:53 PM UTChutStatusIn Progress=>Fixed
    Thu 01 Jul 2010 07:59:14 PM UTChutStatusNone=>In Progress
      Assigned toNone=>hut

    Back to the top


    Powered by Savane 3.1-cleanup1