bugranger - Bugs: bug #31687, UnicodeDecodeError in rare cases...

 
 

bug #31687: UnicodeDecodeError in rare cases in the preview

Submitted by:  Roman Z. <hut>
Submitted on:  Wed 17 Nov 2010 07:38:01 PM 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.

 

Sat 08 Oct 2011 08:44:06 PM UTC, comment #1:

Wrong. This failed because ranger opened the file with a wrong encoding.

Roman Z. <hut>
Project Administrator
Wed 17 Nov 2010 07:38:01 PM UTC, original submission:

Quote:

for your information, I also got this crash during a .pdf preview :
ranger --debug
Traceback (most recent call last):
  File "/usr/lib/python3.1/site-packages/ranger/core/main.py", line 85, in main
    fm.loop()
  File "/usr/lib/python3.1/site-packages/ranger/core/fm.py", line 190, in loop
    loader.work()
  File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 234, in work
    self.fm.notify(err)
  File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 229, in work
    next(item.load_generator)
  File "/usr/lib/python3.1/site-packages/ranger/core/loader.py", line 98, in generate
    read = read.decode('utf-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 511: unexpected end of data

This is because ranger encodes the partial read data, which may end before the end of the unicode character. Gotta do the encoding at the end instead

Roman Z. <hut>
Project Administrator

 

(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 (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Oct 2011 08:44:06 PM UTChutStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1