Modify ↓
Opened 17 years ago
Closed 10 years ago
#4930 closed defect (fixed)
[Patch] "TypeError: can't compare datetime.datetime to float" if search term appears in both wiki and attachments
| Reported by: | Owned by: | deltroo | |
|---|---|---|---|
| Priority: | normal | Component: | SearchAttachmentsPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.11 |
Description
If you have a search term that appears in both the wiki and an attachment, Trac throws an error "TypeError: can't compare datetime.datetime to float".
My guess, from the error text, is that it is trying to sort the search results into date order, but is getting different date types from the different areas.
How to Reproduce
While doing a GET operation on /search, Trac issued an internal error.
(please provide additional details here)
Request parameters:
{'attachments': u'on',
'milestone': u'on',
'noquickjump': u'1',
'q': u'repositories',
'ticket': u'on',
'wiki': u'on'}
User Agent was: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.8) Gecko/2009032711 Ubuntu/8.10 (intrepid) Firefox/3.0.8
System Information
| Trac | 0.11.4
|
| Python | 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2]
|
| setuptools | 0.6c9
|
| SQLite | 3.5.9
|
| pysqlite | 2.3.2
|
| Genshi | 0.5.1
|
| jQuery: | 1.2.6
|
Python Traceback
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/web/main.py", line 435, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/web/main.py", line 205, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/search/web_ui.py", line 107, in process_request
results.sort(lambda x,y: cmp(y[2], x[2]))
File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/search/web_ui.py", line 107, in <lambda>
results.sort(lambda x,y: cmp(y[2], x[2]))
TypeError: can't compare datetime.datetime to float
Attachments (1)
Change History (3)
Changed 17 years ago by
| Attachment: | 4930_1.patch added |
|---|
comment:2 Changed 16 years ago by
| Summary: | Trac reports "TypeError: can't compare datetime.datetime to float" if search term appears in both wiki and attachments → [Patch] "TypeError: can't compare datetime.datetime to float" if search term appears in both wiki and attachments |
|---|
comment:3 Changed 10 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note: See
TracTickets for help on using
tickets.



In 14892: