Edgewall Software

Opened 17 years ago

Closed 17 years ago

#1190 closed defect (fixed)

log view on root of repository aborts with error "list index out of bound"

Reported by: moschny@… Owned by: Christopher Lenz
Priority: highest Milestone: 0.8.1
Component: version control/log view Version: devel
Severity: critical Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


The root url for our trac project is http://our.server/trac/ourproject. Now, navigating to http://our.server/trac/ourproject/log shows

2005-02-07 18:52:58,211 Trac[core] ERROR: list index out of range
2005-02-07 18:52:58,211 Trac[core] ERROR: Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/ModPythonHandler.py", line 194, in handler
    core.dispatch_request(mpr.path_info, args, mpr, env)
  File "/usr/lib/python2.3/site-packages/trac/core.py", line 435, in dispatch_request
  File "/usr/lib/python2.3/site-packages/trac/Module.py", line 44, in run
  File "/usr/lib/python2.3/site-packages/trac/Log.py", line 144, in render
    self.generate_path_links(rev, rev_specified)
  File "/usr/lib/python2.3/site-packages/trac/Log.py", line 86, in generate_path_links
    self.req.hdf.setValue('log.filename', list[-1])
IndexError: list index out of range

Here is a quick fix:

--- Log.py.orig 2005-02-03 12:17:13.000000000 +0100
+++ Log.py      2005-02-07 19:20:13.000000000 +0100
@@ -83,7 +83,11 @@
     def generate_path_links(self, rev, rev_specified):
         list = filter(None, self.path.split('/'))
         path = '/'
-        self.req.hdf.setValue('log.filename', list[-1])
+        if len(list) == 0:
+            filename=''
+        else:
+            filename=list[-1]
+        self.req.hdf.setValue('log.filename', filename)
         self.req.hdf.setValue('log.href' , self.env.href.log(self.path))
         self.req.hdf.setValue('log.path.0', 'root')
         if rev_specified:

Attachments (0)

Change History (3)

comment:1 by Christopher Lenz, 17 years ago

Milestone: 0.8.1
Owner: changed from Jonas Borgström to Christopher Lenz
Status: newassigned
Version: 0.8devel

comment:2 by Christopher Lenz, 17 years ago

Priority: normalhighest
Severity: normalcritical

comment:3 by Christopher Lenz, 17 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [1243], ported to stable in [1244].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.