Modify

Opened 13 years ago

Closed 12 years ago

#10047 closed enhancement (fixed)

TypeError: can't compare datetime.datetime to datetime.date

Reported by: anonymous12 Owned by: Ryan J Ollos
Priority: normal Component: TracMetrixPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

There's an error in mdashboard.py: Line 442 must be

begin_date = to_datetime(min_time).date()

instead of

begin_date = to_datetime(min_time)

Otherwise I get the error

TypeError: can't compare datetime.datetime to datetime.date

when clicking any milestone in the Metrics Milestone Summary.

Log entry:

2012-05-22 14:39:46,821 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\trac\web\main.py", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python27\lib\site-packages\trac\web\main.py", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File "build\bdist.win32\egg\tracmetrixplugin\mdashboard.py", line 355, in process_request
    return self._render_view(req, db, milestone)
  File "build\bdist.win32\egg\tracmetrixplugin\mdashboard.py", line 450, in _render_view
    numdates = drange(begin_date, end_date + timedelta(days=1), timedelta(days=1))
  File "C:\Python27\lib\site-packages\matplotlib\dates.py", line 305, in drange
    if dinterval_end >= dend:               #ensure, that an half open interval will be generated [dstart, dend)
TypeError: can't compare datetime.datetime to datetime.date

    

Attachments (0)

Change History (1)

comment:1 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

(In [11671]) Fixes #10047: Datetime and Date objects were being compared.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.