3467: Server error when viewing certain posted reviews

sour*****@gmai***** (Google Code) (Is this you? Claim this profile.)
July 7, 2014
What version are you running?


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

(Please don't visit this excessively, we get an email for each internal error Reviewboard encounters)

What steps will reproduce the problem?
1. Post a diff which contains certain characters which the ASCII character set cannot encode.

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

Normal diff view page.

What operating system are you using? What browser?

Issue is a server error. Using Python 2.7.3 on Linux.

Please provide any additional information below.

Relevant part of the backtrace:

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.2-py2.7.egg/reviewboard/diffviewer/models.py", line 58, in recalculate_line_counts
    files = tool.get_parser(self.binary).parse()

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.2-py2.7.egg/reviewboard/scmtools/git.py", line 181, in parse
    preamble += self.lines[i] + '\n'

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


Patching /usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.2-py2.7.egg/reviewboard/scmtools/git.py as follows appears to fix the issue:

preamble += unicode(self.lines[i], 'utf-8') + '\n'
#1 david
Fixed in release-2.0.x (f4043f5). Thanks!
  • +Fixed