#12628 closed defect (fixed)
IndexError: list index out of range (with solution)
Reported by: | Owned by: | falkb | |
---|---|---|---|
Priority: | low | Component: | SimpleMultiProjectPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
The Problem
Before installing the plugin I could get to my trac (v0.12.5) page on http://example.com/trac, but after installing it I couldn't and it throws an IndexError: list index out of range. Funny thing, I could still get to the page using http://example.com/trac/ (note the final slash).
The Cause
Taking a look on the traceback I found what was cousing the error: in some files there is a condition checking if the URL matches roadmap or timeline but it asumes that the URL has at least one slash (/) after the base dir. When it isn't (like in http://example.com/trac) the index is out of range.
The Solution
In order to fix this you should modify the condition and test first if that index exist (using len(path_elms) > 1
). This should be added to the following lines:
- source:simplemultiprojectplugin/trunk/simplemultiproject/roadmap.py#L52
- source:simplemultiprojectplugin/trunk/simplemultiproject/roadmap.py#L161
- source:simplemultiprojectplugin/trunk/simplemultiproject/roadmap.py#L248
- source:simplemultiprojectplugin/trunk/simplemultiproject/timeline.py#L37
- source:simplemultiprojectplugin/trunk/simplemultiproject/timeline.py#L66
Hope this helps. Best regards!
Alvaro Flaño
In 15338: