Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

#10258 closed defect (worksforme)

TypeError: can't compare datetime.datetime to str

Reported by: MarkusWolff@… Owned by:
Priority: normal Milestone:
Component: general Version: 0.12
Severity: normal Keywords: needinfo
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /query, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'desc': u'1', 'order': u'summary', 'owner': u'Sven'}

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

System Information

Trac 0.12
Genshi 0.6
mod_python 3.3.1
Pygments 0.10
pysqlite 2.4.1
Python 2.5.2 (r252:60911, Jan 24 2010, 15:24:24)
[GCC 4.3.2]
pytz 2008c
setuptools 0.6c8
SQLite 3.5.9
jQuery 1.4.2

Enabled Plugins

AdvancedTicketWorkflowPlugin 0.10dev
BasicThemeEditorPlugin 0.1
IniAdmin 0.2
timingandestimationplugin 1.0.8
TracAccountManager 0.2.1dev
TracPrivateTickets 2.0.2

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/trac/ticket/query.py", line 933, in process_request
    return self.display_html(req, query)
  File "build/bdist.linux-i686/egg/trac/ticket/query.py", line 1052, in display_html
    data = query.template_data(context, tickets, orig_list, orig_time, req)
  File "build/bdist.linux-i686/egg/trac/ticket/query.py", line 732, in template_data
    elif ticket['changetime'] > orig_time:
TypeError: can't compare datetime.datetime to str

Attachments (0)

Change History (4)

comment:1 by Remy Blank, 13 years ago

Keywords: needinfo added

From the traceback, it seems that either orig_time or ticket['changetime'] is a str. Looking at the code for 0.12, orig_time it is either given by datetime.now(utc) or by datetime.fromtimestamp(int(req.session.get('query_time', 0))), both of which generate a datetime.

So ticket['changetime'] must be a string. But it is set to the value of from_utimestamp(row[i]), which returns a datetime as well.

At this point, I suspect a plugin. Could you please try to reproduce the issue with all plugins disabled?

comment:2 by Christian Boos, 13 years ago

This has already been reported in ticket:6088#comment:11, the conclusion there was that a plugin probably inserted a blank value for changetime

comment:3 by MarkusWolff@…, 13 years ago

Thanks a lot, the issue was a wrong changetime value (=-1) on some tickets. For me is the issue solved.

comment:4 by Remy Blank, 13 years ago

Resolution: worksforme
Status: newclosed

Thanks for the feedback.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) 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.