Ticket #3365 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

IndexError: list index out of range peerReviewView.html

Reported by: ron@byressecurity.com Assigned to: proofek
Priority: normal Component: PeerReviewPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (Last modified by proofek)

Error: IndexError?: list index out of range

When user searches for code reviews or views any that aren't theirs the Index error appears when they choose one of the reviews that appears. There error happens on http://192.168.2.33/trac/peerReviewView?Review=2 for example.

Quick Fix: edit the html in /tmp/.pythoneggs/ and in the templates and on the peerReviewView.html Edit the following to look like example beneath it:

<tr py:if="filesLength > 0" py:for="item in rvs" class="${cls.next()}">

<td>${item[0]}</td> <td>${item[1]}</td>

</tr>

<tr py:if="filesLength > 0" py:for="item in rvs" class="${cls.next()}">

<td>${item[0]}</td>

</tr>

The problem is if you restart trac this change is not there.

Traceback:

File "/tmp/.python-eggs/TracCodeReview-2.1_toddlerdev_r0-py2.4.egg-tmp/codereview/templates/peerReviewView.html", line 93, in <Expression u'item[1]'>

<td>${item[1]}</td>

System Info:

System Information:

User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.15) Gecko/20080702 Fedora/2.0.0.15-1.fc8 Firefox/2.0.0.15 Trac: 0.11 Python: 2.4.3 (#1, May 24 2008, 13:47:28) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] setuptools: 0.6c8 SQLite: 3.3.6 pysqlite: 1.1.7 Genshi: 0.5 mod_python: 3.2.8 Pygments: 0.10 jQuery: 1.2.3

Attachments

Change History

07/14/08 18:22:04 changed by ron@byressecurity.com

  • release changed from 0.10 to 0.11.

Quick edit: Trac version

09/16/08 04:23:29 changed by Nate

We are also getting this error, and it's pretty much a showstopper for us, as peer review was the thing that attracted us to Trac.

09/20/08 00:00:37 changed by Nate

Okay, I fixed this in our local install. There are a few bugs in PeerReviewView?.py (at least in the 2.1toddler version we're on):

  1. There is a numeric flag in datamanager? that is being compared to a string RESULT: code review managers don't get recognized as such
  1. When the viewing user is neither the code review author nor a manager, only one item is placed in the newrvpair array. When later checked at PierReviewView?.html:93, the code displays contents of newrvpair[1] without checking whether it actually exists RESULT: the IndexError? described in this issue.

09/20/08 00:09:41 changed by NateClark

Nate again - I just registered as an actual user. Presumably that will allow you to contact me if desired. If not, here: nate.clark at_symbol brulant dot_symbol com

02/07/09 19:27:00 changed by anonymous

I had the same problem, I then changed the line causing the problem to the following and reinstalled the plugin.

<td py:if="len(item) >= 2">${item[1]}</td>

02/12/09 22:47:58 changed by proofek

  • status changed from new to closed.
  • resolution set to fixed.
  • description changed.

Fixed on 2.2-dev branch


Add/Change #3365 (IndexError: list index out of range peerReviewView.html)




Change Properties
Action