Modify

Opened 10 years ago

Closed 10 years ago

#1826 closed defect (fixed)

Error in Timeline.

Reported by: anonymous Owned by: Colin Guthrie
Priority: normal Component: WorkLogPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

Hi, after installing this plug in, I have problems accessing the time line: if I choose to see Work log events i get the following error:

Internal Error

Work Log changes event provider (WorkLogTimelineAddon) failed:

TypeError: argument to += must be iterable

You may want to see the other kind of events from the Timeline

TracGuide — The Trac User and Administration Guide

Is there anything I've missed? I've search google and the ticket system but could not find any clue.

I'm using trac 0.10.4 on debian etch with the following plugins installed:

  • webAdmin (0.1.2dev-r4240)
  • workLog (0.1)
  • XMLRPC (0.1)
  • Tags (0.4.1)
  • Timing and estimation (0.4.6)

Attachments (4)

patch.diff (467 bytes) - added by Colin Guthrie 10 years ago.
You can try this. It's one of the few places that += is used when it's possible that python may not like it - I doubt it tho!! Probably more likely that it doesn't work when there are no log events!
trac.log (29.1 KB) - added by anonymous 10 years ago.
This is the log file. I turned on Debug level. I had a look at it but coul not find anything but the message I posted in the ticket description.
patch.2.diff (1.0 KB) - added by anonymous 10 years ago.
This patch solves the problem in the time line with python 2.4 (debian sarge)
patch.txt (1.0 KB) - added by anonymous 10 years ago.
...sorry, I did not included the file properly.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 10 years ago by Colin Guthrie

Weird!

I don't even use += in the timeline.... can you make sure you've got the latest svn of worklog? It may be that I've factored it out recently... and I've not changed the version number on most updates so far as I don't really consider it worthy of a proper release yet!!

I'll try in my demo system without any work_log entries and see if I can replicate. The plugins you have installed does not look like it should cause any problems unless there is some weird problem with the Tags plugin (one that I don't have).

Changed 10 years ago by Colin Guthrie

Attachment: patch.diff added

You can try this. It's one of the few places that += is used when it's possible that python may not like it - I doubt it tho!! Probably more likely that it doesn't work when there are no log events!

comment:2 Changed 10 years ago by Colin Guthrie

Hmm I've tried with an empty database, but it still works fine for me. I'm using python 2.5.

If you turn on logging in Trac can you get a backtrace for me from the error log? Thanks.

comment:3 in reply to:  2 Changed 10 years ago by anonymous

Replying to coling:

Hmm I've tried with an empty database, but it still works fine for me. I'm using python 2.5.

If you turn on logging in Trac can you get a backtrace for me from the error log? Thanks.

...Well, I'm using python 2.3. Could it make a difference?.

I'll turn on loggin and I'll post here any info I get.

Thanks,

Alfonso

comment:4 in reply to:  1 ; Changed 10 years ago by anonymous

Replying to coling:

Weird!

I don't even use += in the timeline.... can you make sure you've got the latest svn of worklog?

I didn't check it out from SVN, I downloaded the zip from the web page (this link). I'll try the svn version and keep you updated.

Alfonso.

comment:5 Changed 10 years ago by Colin Guthrie

As long as you downloaded it recently the link should be fine as I've not made changes for a few days.... I should really update the version number on each major commit to make it easier for reporting :)

Python 2.3 may be the factor here, but I'm not enough of an expert to know :(

Changed 10 years ago by anonymous

Attachment: trac.log added

This is the log file. I turned on Debug level. I had a look at it but coul not find anything but the message I posted in the ticket description.

comment:6 in reply to:  4 Changed 10 years ago by anonymous

Replying to anonymous:

Replying to coling:

Weird!

I don't even use += in the timeline.... can you make sure you've got the latest svn of worklog?

I didn't check it out from SVN, I downloaded the zip from the web page (this link). I'll try the svn version and keep you updated.

Alfonso.

I just checked out the last version from SVN. Should I do anything especial to reinstal it or a simple easy_install just overrides the older version?

Alfonso.

comment:7 Changed 10 years ago by anonymous

Well, as coling said, the problem was due to the python version. I installed python 2.4, upgraded all the plugins and now I get my time line back. Now:

  • I open and ticket and start working on it.
  • The worklog shows i'm working on the ticket.
  • The time line shows I started working on the ticket.
  • After a few minutes I open the ticket and stop working on it.
  • The worklog shows the ticket is idle.
  • The time line shows this error:
    Work Log changes event provider (WorkLogTimelineAddon) failed:
    
    TypeError: a float is required
    

The log doesn't show any other information apart from the above message.

comment:8 Changed 10 years ago by Colin Guthrie

Thanks for the info re: python version. I'll put a note on the minimum requirements. As I use Python 2.5 here it's hard to do backwards compatibility testing, but if people submit patches that make it backwards compatible then I'm happy to apply.

On to the error I've obviously done something silly! Can you get a debug log for that with a backtrace? Line numbers etc. would be useful so I know where to do the casts....

comment:9 in reply to:  8 Changed 10 years ago by anonymous

Replying to coling:

Thanks for the info re: python version. I'll put a note on the minimum requirements. As I use Python 2.5 here it's hard to do backwards compatibility testing, but if people submit patches that make it backwards compatible then I'm happy to apply.

On to the error I've obviously done something silly! Can you get a debug log for that with a backtrace? Line numbers etc. would be useful so I know where to do the casts....

Problem was in datetime.fromtimestamp and datetime.fromtimestamp functions. After applying this patch, the time line is back again and apparently working:

*** timeline_hook.py    2007-07-20 11:30:03.000000000 +0200
--- timeline_hook_sarge.py      2007-07-20 11:30:18.000000000 +0200
***************
*** 55,62 ****
                                     (user, humankind, summary, ticket))
                  message = ''
                  if kind == 'workstop':
!                     started = datetime.fromtimestamp(starttime)
!                     finished = datetime.fromtimestamp(time)
                      message = 'Time spent: ' + pretty_timedelta(started, finished)
                  yield kind, ticket_href, title, time, user, message

--- 55,62 ----
                                     (user, humankind, summary, ticket))
                  message = ''
                  if kind == 'workstop':
!                     started = datetime.fromtimestamp(float(starttime))
!                     finished = datetime.fromtimestamp(float(time))
                      message = 'Time spent: ' + pretty_timedelta(started, finished)
                  yield kind, ticket_href, title, time, user, message

Changed 10 years ago by anonymous

Attachment: patch.2.diff added

This patch solves the problem in the time line with python 2.4 (debian sarge)

Changed 10 years ago by anonymous

Attachment: patch.txt added

...sorry, I did not included the file properly.

comment:10 Changed 10 years ago by Colin Guthrie

Resolution: fixed
Status: newclosed

(In [2495]) Closes #1826 by ensuring correct variable type for timestamps (float)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Colin Guthrie.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.