Edgewall Software

Opened 17 years ago

Last modified 14 years ago

#6088 closed defect

<coderanger_> jg: The problem is we cache the results of the current query for speed, and that list now contains deleted tickets for you. — at Initial Version

Reported by: anonymous Owned by: Matthew Good
Priority: high Milestone: 0.11
Component: report system Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Oops… Trac detected an internal error:

TypeError: can't compare datetime.datetime to int

If you think this should work you can reproduce the problem, you should consider reporting this to the Trac team.

Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket.

Otherwise, please ==== How to Reproduce ==== While doing a GET operation on /query, Trac issued an internal error. (please provide additional details here) Request parameters: {'milestone': u'Untriaged', 'order': u'priority', 'status': [u'new', u'assigned', u'reopened']} ==== System Information ====
Trac 0.11dev-r5992 Python 2.5.1 (r251:54863, May 2 2007, 16:27:44)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)]
setuptools 0.6c7 SQLite 3.3.13 pysqlite 2.3.2 Genshi 0.4.4 ==== Python Traceback ==== Traceback (most recent call last): File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/web/main.py", line 381, in dispatch_request dispatcher.dispatch(req) File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/web/main.py", line 191, in dispatch resp = chosen_handler.process_request(req) File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 638, in process_request return self.display_html(context, query) File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 720, in display_html data = query.template_data(context, tickets, orig_list, orig_time) File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 506, in template_data if ticket['time'] > orig_time: TypeError: can't compare datetime.datetime to int a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it.

Python Traceback Most recent call last:

  • File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/web/main.py", line 381, in dispatch_request Code fragment:
    1. if not env and env_error:
    2. raise HTTPInternalError(env_error)
    3. try:
    4. try:
    5. dispatcher = RequestDispatcher(env)
    6. dispatcher.dispatch(req)
    7. except RequestDone:
    8. pass
    9. return req._response or []
    10. finally:
    11. if not run_once:
    Local variables: Name Value after [' except RequestDone:', ' pass', ' … before [' if not env and env_error:', ' raise … dispatcher <trac.web.main.RequestDispatcher object at 0x121e0d0> e TypeError("can't compare datetime.datetime to int",) env <trac.env.Environment object at 0xd26cd0> env_error None env_path '/home/olpc-code/newtrac' environ {'trac.base_url': u'https://dev.laptop.org/', 'wsgi.multiprocess': True, … exc_info (<type 'exceptions.TypeError'>, TypeError("can't compare datetime.datetime … filename '/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.eg … frames [{'function': 'dispatch_request', 'lines_before': [' if not env and … has_admin True line ' dispatcher.dispatch(req)' lineno 380 message u"TypeError: can't compare datetime.datetime to int" path_info '/query' req <Request "GET u'/query'"> run_once False script_url '/query' start_response <function start_response at 0x44bf050> tb <traceback object at 0x2fd6b48> tb_hide None traceback 'Traceback (most recent call last):\n File …
  • File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/web/main.py", line 191, in dispatch Code fragment:
    1. 'Do you have cookies enabled?')
    2. # Process the request and render the template
    3. try:
    4. try:
    5. resp = chosen_handler.process_request(req)
    6. if resp:
    7. if len(resp) == 2: # Clearsilver
    8. chrome.populate_hdf(req)
    9. template, content_type = \
    10. self._post_process_request(req, *resp)
    Local variables: Name Value chosen_handler <trac.ticket.query.QueryModule object at 0x1267910> chrome <trac.web.chrome.Chrome object at 0x110f490> err (<type 'exceptions.TypeError'>, TypeError("can't compare datetime.datetime … handler <trac.ticket.query.QueryModule object at 0x1267910> req <Request "GET u'/query'"> self <trac.web.main.RequestDispatcher object at 0x121e0d0>
  • File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 638, in process_request Code fragment:
    1. format = req.args.get('format')
    2. if format:
    3. Mimeview(self.env).send_converted(req, 'trac.ticket.Query', query,
    4. format, 'query')
    5. return self.display_html(context, query)
    6. # Internal methods
    7. def _get_constraints(self, req):
    8. constraints = {}
    Local variables: Name Value cols None constraints {'status': [u'new', u'assigned', u'reopened'], 'milestone': … context <Context '[root]' <Request "GET u'/query'">> conversion ('tab', 'Tab-delimited Text', 'tsv', 'trac.ticket.Query', … format None query <trac.ticket.query.Query object at 0x1c322d0> req <Request "GET u'/query'"> rows [] self <trac.ticket.query.QueryModule object at 0x1267910>
  • File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 720, in display_html Code fragment:
    1. except TracError, e:
    2. data = {'id': rest_id, 'time': 0, 'changetime': 0,
    3. 'summary': tag.em(e)}
    4. tickets.insert(orig_list.index(rest_id), data)
    5. data = query.template_data(context, tickets, orig_list, orig_time)
    6. # For clients without JavaScript, we add a new constraint here if
    7. # requested
    8. constraints = dataconstraints
    9. if 'add' in req.args:
    Local variables: Name Value context <Context '[root]' <Request "GET u'/query'">> data {'changetime': 0, 'summary': <Element "em">, 'id': 3863, 'time': 0} db <trac.db.pool.PooledConnection object at 0x44bae60> e ResourceNotFound('Ticket 3863 does not exist.',) id u'3863' orig_list [3813, 3830, 2448, 2651, 2712, 2717, 2837, 2839, 2926, 2973, 3117, 3782, … orig_time datetime.datetime(2007, 9, 26, 17, 26, 2, tzinfo≤FixedOffset "UTC" … query <trac.ticket.query.Query object at 0x1c322d0> query_constraints u"{'status': [u'new', u'assigned', u'reopened'], 'milestone': … query_time datetime.datetime(2007, 9, 26, 17, 26, 2, tzinfo≤FixedOffset "UTC" … req <Request "GET u'/query'"> rest_id 3863 rest_list [3813, 2448, 2651, 2712, 3825, 3826, 3827, 3828, 3829, 3831, 3832, 3833, … self <trac.ticket.query.QueryModule object at 0x1267910> t {u'status': u'new', u'changetime': datetime.datetime(2007, 9, 26, 17, 9, … ticket <trac.ticket.model.Ticket object at 0x345c5d0> tickets [{'status': u'new', 'changetime': datetime.datetime(2007, 9, 26, 17, 27, … tid 3821
  • File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 506, in template_data Code fragment:
    1. groupsequence = []
    2. for ticket in tickets:
    3. if orig_list:
    4. # Mark tickets added or changed since the query was first
    5. # executed
    6. if tickettime > orig_time:
    7. ticketadded = True
    8. elif ticketchangetime > orig_time:
    9. ticketchanged = True
    10. if self.group:
    11. group_key = ticket[self.group]
    Local variables: Name Value col 'component' cols ['id', 'summary', 'status', 'owner', 'type', 'priority', 'component'] constraint {'values': [u'Untriaged'], 'mode': } constraints {'status': {'values': [u'new', u'assigned', u'reopened'], 'mode': }, … context <Context '[root]' <Request "GET u'/query'">> f {'name': 'verified', 'value': u, 'custom': True, 'label': u'Verified', … field {'name': 'verified', 'value': u, 'custom': True, 'label': u'Verified', … field_data {'label': u'Verified', 'type': u'checkbox', 'order': 0, 'value': u, … fields {'status': {'optional': True, 'type': 'radio', 'options': [u'assigned', … groups {} groupsequence [] headers [{'href': … k 'milestone' labels {'status': 'Status', 'changetime': 'Modified', 'verified': u'Verified', … mode modes {'text': [{'name': 'contains', 'value': '~'}, {'name': "doesn't contain", … neg False orig_list [3813, 3830, 2448, 2651, 2712, 2717, 2837, 2839, 2926, 2973, 3117, 3782, … orig_time datetime.datetime(2007, 9, 26, 17, 26, 2, tzinfo≤FixedOffset "UTC" … self <trac.ticket.query.Query object at 0x1c322d0> ticket {'changetime': 0, 'summary': <Element "em">, 'id': 3825, 'time': 0} tickets [{'status': u'new', 'changetime': datetime.datetime(2007, 9, 26, 17, 27, … v [u'Untriaged'] val u'Untriaged'

File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/web/main.py", line 381, in dispatch_request

dispatcher.dispatch(req)

File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/web/main.py", line 191, in dispatch

resp = chosen_handler.process_request(req)

File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 638, in process_request

return self.display_html(context, query)

File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 720, in display_html

data = query.template_data(context, tickets, orig_list, orig_time)

File "/home/coderanger/local-trac-0.11/lib/python2.5/Trac-0.11dev_r5992-py2.5.egg/trac/ticket/query.py", line 506, in template_data

if tickettime > orig_time:

System Information:

User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty) Trac: 0.11dev-r5992 Python: 2.5.1 (r251:54863, May 2 2007, 16:27:44) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] setuptools: 0.6c7 SQLite: 3.3.13 pysqlite: 2.3.2 Genshi: 0.4.4 jQuery: 1.1.3.1

TracGuide — The Trac User and Administration Guide Trac Powered

Powered by Trac 0.11dev-r5992

Change History (0)

Note: See TracTickets for help on using tickets.