Edgewall Software
Modify

Ticket #3959 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

IndexError: tuple index out of range

Reported by: james@… Owned by: cboos
Priority: high Milestone: 0.11
Component: version control/browser Version: devel
Severity: trivial Keywords:
Cc:
Release Notes:
API 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

Change History

comment:1 Changed 5 years ago by cboos

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 Changed 5 years ago by cboos

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:3 Changed 5 years ago by cboos

  • Keywords tuple removed
  • Severity changed from normal to trivial
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.