Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

#2707 closed defect (fixed)

String index out of range

Reported by: littleb Owned by: Jonas Borgström
Priority: high Milestone: 0.9.4
Component: search system Version: 0.9.3
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:

Description

 http://example.com/trac/search?q=%de

string index out of range

Python traceback

Traceback (most recent call last):
  File "/usr/share/python2.4/site-packages/trac/web/modpython_frontend.py", line 206, in handler
  File "/usr/share/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request
  File "/usr/share/python2.4/site-packages/trac/web/main.py", line 107, in dispatch
  File "/usr/share/python2.4/site-packages/trac/Search.py", line 146, in process_request
  File "/usr/share/python2.4/site-packages/trac/Search.py", line 224, in quickjump
IndexError: string index out of range

Attachments (0)

Change History (7)

comment:1 by Manuzhai, 14 years ago

I cannot reproduce this on projects.edgewall.com/trac/ at this time.

comment:2 by Manuzhai, 14 years ago

Nor on my internal source:/trunk/@2861 installation.

comment:3 by Matthew Good, 14 years ago

Resolution: worksforme
Status: newclosed

I can't reproduce either. Trac requires a query string of at least 3 characters, so the above query is rejected since it's too short.

comment:4 by anonymous, 14 years ago

Resolution: worksforme
Status: closedreopened
python-2.4.2
apache-2.2.0
apache-mod_python-3.1.4
default_charset = utf-8

see this

comment:5 by Matthew Good, 14 years ago

Resolution: worksforme
Status: reopenedclosed

Your config doesn't change the fact that you need to enter a query of at least 3 characters, and your example above only includes 1 character in the search string. Please check if you've made local modifications that are broken, or provide more information to reproduce the problem.

comment:6 by anonymous, 14 years ago

Resolution: worksforme
Status: closedreopened

Try instead searching for the letter F.

It looks like the quickjump code is run before the length check. This is probably so that #1 takes you to ticket:1 instead of telling you your query is too short. If you enter just one letter and it is upper case the bug is triggered. That is, kwd[0].isupper() passes and kwd[1].islower() raises the IndexError. Adding a len(kwd) > 1 at the front of the elif test or as guard to the whole function (as none of the clauses can pass with len ⇐ 1) should fix it.

comment:7 by Christian Boos, 14 years ago

Milestone: 0.9.4
Resolution: fixed
Status: reopenedclosed
Summary: [mod_python] String index out of rangeString index out of range

Thanks for the clarification. Fixed in r2863 and r2864.

Modify Ticket

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