Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#3959 closed defect (fixed)

IndexError: tuple index out of range

Reported by: james@… Owned by: Christian Boos
Priority: high Milestone: 0.11
Component: version control/browser Version: devel
Severity: trivial Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /log/frontend/trunk/config/routes.rb, Trac issued an internal error.

System Information

Python 2.4 (#1, Jan 16 2005, 19:22:46)
[GCC 3.3.2 20031022 (Red Hat Linux 3.3.2-1)]
Subversion 1.1.3
SQLite 2.8.15
pysqlite 1.0.1

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 377, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line 248, in dispatch
    content_type, data)
  File "/usr/local/lib/python2.4/site-packages/trac/web/chrome.py", line 483, in render_response
    return stream.render(method, doctype=doctype)
  File "build/bdist.linux-i686/egg/genshi/core.py", line 146, in render
  File "build/bdist.linux-i686/egg/genshi/output.py", line 200, in __call__
  File "build/bdist.linux-i686/egg/genshi/output.py", line 486, in __call__
  File "build/bdist.linux-i686/egg/genshi/output.py", line 436, in __call__
  File "build/bdist.linux-i686/egg/genshi/core.py", line 207, in _ensure
  File "build/bdist.linux-i686/egg/genshi/filters.py", line 313, in __call__
  File "build/bdist.linux-i686/egg/genshi/template.py", line 1142, in _match
  File "build/bdist.linux-i686/egg/genshi/filters.py", line 313, in __call__
  File "build/bdist.linux-i686/egg/genshi/template.py", line 1117, in _match
  File "build/bdist.linux-i686/egg/genshi/template.py", line 1106, in _strip
  File "build/bdist.linux-i686/egg/genshi/template.py", line 940, in _eval
  File "build/bdist.linux-i686/egg/genshi/template.py", line 906, in _eval
  File "build/bdist.linux-i686/egg/genshi/template.py", line 956, in _flatten
  File "build/bdist.linux-i686/egg/genshi/template.py", line 950, in _flatten
  File "build/bdist.linux-i686/egg/genshi/template.py", line 454, in __call__
  File "build/bdist.linux-i686/egg/genshi/template.py", line 767, in __call__
  File "build/bdist.linux-i686/egg/genshi/eval.py", line 103, in evaluate
  File "/usr/local/share/trac/templates/macros.html", line 33, in <Expression "?">
    <label py:for="button in buttons"
  File "build/bdist.linux-i686/egg/genshi/eval.py", line 227, in _lookup_item
IndexError: tuple index out of range

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 18 years ago

Please try out this patch:

Index: macros.html
===================================================================
--- macros.html	(revision 3975)
+++ macros.html	(working copy)
@@ -31,7 +31,9 @@
   -->
   <py:def function="radiobuttons(selector, name, buttons)">
     <label py:for="button in buttons"
-           py:with="value = button[0]; text = button[1] or button[0]; default = button[3]">
+           py:with="value = button[0];
+                    text = len(button) > 1 and button[1] or button[0];
+                    default = len(button) > 2 and button[2]">
       <input type="radio" id="$value" name="$name" value="$value"
         checked="${selector == value or (default and selector not in values) and 'checked' or None}" />
       $text

comment:2 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

Got around to test it myself ;) Fixed by r3979.

comment:3 by Christian Boos, 18 years ago

Keywords: tuple removed
Severity: normaltrivial

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.