Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1359 by pinge...@yahoo.com: Diff fails for text file with  
non-ascii characters
http://code.google.com/p/reviewboard/issues/detail?id=1359

What version are you running?

Review board 1.0 on Python 2.4

What's the URL of the page containing the problem?

http://<omitted>/reviews/r/658/diff/#index_header

What steps will reproduce the problem?
1. Create a text file containing the byte 0xED (in Windows, Alt+0237)
    This character corresponds to the "latin small letter i with acute" in
the Windows Western encoding.
2. Check this into source control
3. Edit the file to replace this character with a lowercase 'i'
4. Post the change to review board
5. Attempt to view the diff

(This actually happened to me today -- I was trying to fix a source file
that had this non-ascii, non utf-8 character in a docstring)

What is the expected output? What do you see instead?

I would expect to see a diff, possibly with invalid characters replaced by
hexadecimal representations.

Instead I get the following traceback:

'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in  
range(128)

Traceback (most recent call last):
   File
"/usr/lib/python2.4/site-packages/ReviewBoard-1.0-py2.4.egg/reviewboard/diffviewer/views.py",
line 152, in view_diff
     interdiffset, highlighting, True)
   File
"/usr/lib/python2.4/site-packages/ReviewBoard-1.0-py2.4.egg/reviewboard/diffviewer/diffutils.py",
line 623, in get_diff_files
     large_data=True)
   File
"/usr/lib/python2.4/site-packages/Djblets-0.5-py2.4.egg/djblets/util/misc.py",
line 143, in cache_memoize
     data = lookup_callable()
   File
"/usr/lib/python2.4/site-packages/ReviewBoard-1.0-py2.4.egg/reviewboard/diffviewer/diffutils.py",
line 622, in <lambda>
     enable_syntax_highlighting),
   File
"/usr/lib/python2.4/site-packages/ReviewBoard-1.0-py2.4.egg/reviewboard/diffviewer/diffutils.py",
line 434, in get_chunks
     a[i1:i2], b[j1:j2], oldlines, newlines)
   File
"/usr/lib/python2.4/site-packages/ReviewBoard-1.0-py2.4.egg/reviewboard/diffviewer/diffutils.py",
line 268, in diff_line
     if oldline and newline and oldline != newline:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26:
ordinal not in range(128)

What operating system are you using? What browser?

Firefox 3.5.3 on Windows XP SP3

Please provide any additional information below.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to