Modify

Opened 2 years ago

Closed 2 years ago

#10047 closed enhancement (fixed)

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

Reported by: anonymous12 Owned by: 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 (0)

Change History (1)

comment:1 Changed 2 years ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.