Modify

Opened 13 years ago

Closed 11 years ago

#8235 closed defect (fixed)

[error] AttributeError: 'module' object has no attribute 'now'

Reported by: gustavo.diaz@… Owned by: Ryan J Ollos
Priority: normal Component: TracMetrixPlugin
Severity: normal Keywords: needinfo
Cc: Trac Release: 0.12

Description

Hi guys,

I am using Trac 0.12 - TracMetrixPlugin 0.18 - matplotlib 1.0.0 - Python 2.6.5 Error trying to Show Project Metrics after pressing Update button:

http://pastebin.com/5fVaMWg3

On Py console tested:

>>> from datetime import datetime 
>>> datetime.now()
datetime.datetime(2010, 11, 29, 15, 17, 12, 175421)

So, the fix was to move "from datetime import timedelta, datetime" to the line 33 (which is, at the end of the "imports").

Attachments (0)

Change History (5)

comment:1 Changed 13 years ago by Ryan J Ollos

Status: newassigned
Trac Release: 0.110.12

comment:2 Changed 13 years ago by Ryan J Ollos

I replaced the use of datetime.datetime.now() with trac.util.datefmt.to_datetime().

The following are equivalent:

datetime.now(req.tz)
to_datetime(None, req.tz)

Could you test the version on the trunk and report back if you still have the issue? (Note, I removed the 0.11 and 0.12 branches since they were equivalent, and now there is currently just a trunk)

comment:3 Changed 13 years ago by Ryan J Ollos

(In [9564]) Replaced uses of datetime.now from datetime module with to_datetime from trac.util.datefmt module. Refs #8235.

comment:4 Changed 13 years ago by Ryan J Ollos

Keywords: needinfo added

Will close ticket in 1 month if no follow-up. Thanks.

comment:5 Changed 11 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

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.