Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12482 closed defect (fixed)

Error when displaying Timeline on Trac 1.2

Reported by: sdegrande Owned by: sdegrande
Priority: normal Component: DownloadsPlugin
Severity: normal Keywords:
Cc: Ryan J Ollos Trac Release: 1.2

Description

When opening the Timeline (Trac 1.2, python 2.7), I get this error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.2.dev0-py2.7.egg/trac/timeline/web_ui.py", line 202, in process_request
    events.append(self._event_data(provider, event))
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.2.dev0-py2.7.egg/trac/timeline/web_ui.py", line 380, in _event_data
    dateuid = to_utimestamp(date)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.2.dev0-py2.7.egg/trac/util/datefmt.py", line 112, in to_utimestamp
    diff = dt - _epoc
TypeError: unsupported operand type(s) for -: 'int' and 'datetime.datetime'

Attached is a patch to fix the issue.

Thanks for you work.

Attachments (1)

fix_timeline.patch (656 bytes) - added by sdegrande 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by sdegrande

Attachment: fix_timeline.patch added

comment:1 Changed 4 years ago by Ryan J Ollos

Thanks for the patch. The change is needed due to the removal of deprecated parts of the API in [trac 13589].

comment:2 Changed 4 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 14881:

0.3dev: Returning a datetime object is enforced in Trac 1.1.3 and later.

Patch by sdegrande. Fixes #12482.

comment:3 Changed 4 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to sdegrande

comment:4 Changed 4 years ago by Ryan J Ollos

In 14882:

0.3dev: Don't rely on transitive imports. Refs #12482.

from tracdownloads.api import * brings in to_datetime and utc.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain sdegrande.
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.