Opened 19 years ago
Closed 19 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: | |||
Internal 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 , 19 years ago
comment:3 by , 19 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
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 , 19 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
python-2.4.2 apache-2.2.0 apache-mod_python-3.1.4 default_charset = utf-8
comment:5 by , 19 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
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 , 19 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
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 , 19 years ago
Milestone: | → 0.9.4 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Summary: | [mod_python] String index out of range → String index out of range |
I cannot reproduce this on projects.edgewall.com/trac/ at this time.