Ticket #10047 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

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

Reported by: anonymous12 Assigned to: rjollos
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

Change History

06/20/12 08:15:32 changed by rjollos

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #10047 (TypeError: can't compare datetime.datetime to datetime.date)




Change Properties
Action