3481: 'list index out of range'

bruce*****@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
Oct. 22, 2014
3597
What version are you running?
2.0.3

What's the URL of the page containing the problem?
https://reviews/r/41595/diff/4-9/

What steps will reproduce the problem?
1. With certain changesets that delete files, browsing through the interdiffs will cause the diff viewer to report 'list index out of range' for the deleted file.

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

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/views.py", line 236, in get
    renderer = self.create_renderer(context, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/views.py", line 1088, in create_renderer
    *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/views.py", line 328, in create_renderer
    self.diff_file = self._get_requested_diff_file()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/views.py", line 369, in _get_requested_diff_file
    request=self.request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 373, in populate_diff_chunks
    chunks = generator.get_chunks()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 153, in get_chunks
    large_data=True)
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.6-py2.7.egg/djblets/cache/backend.py", line 109, in cache_memoize
    data = lookup_callable()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 152, in <lambda>
    lambda: list(self._get_chunks_uncached()),
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 288, in _get_chunks_uncached
    yield self._new_chunk(lines, 0, num_lines, False, tag, meta)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 563, in _new_chunk
    compute_chunk_last_header(lines, num_lines, meta, self._last_header)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.3-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 647, in compute_chunk_last_header
    line = lines[0]
IndexError: list index out of range

What operating system are you using? What browser?
Windows 8.1 and Firefox 30.

Please provide any additional information below.

From the same bug on Review Board 2.0.2 (copied from https://reviews.reviewboard.org/r/6030/):

This is from a review that had 5 revisions and failed to display changes for some files between revisions 4 and 5.

    diff 4:
    number of lines: 43
    @@ -1,39 +0,0 @@
    diff 5:
    number of lines: 43
    @@ -1,39 +0,0 @@

    So there were apparently no changes to that file between the two revisions.
#1 ky6u*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Reproduced in 2.0.4.
david
#2 david
  • +PendingReview
  • +Interdiffs
    +Component-DiffViewer
  • +david
david
#3 david
OK, most of this should now be fixed in release-2.0.x (2b23541) and will ship in 2.0.9. There's another small bug that could also cause this traceback, which will also be fixed in 2.0.9
  • -PendingReview
    +Fixed