Modify

Opened 4 years ago

Closed 14 months ago

#8235 closed defect (fixed)

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

Reported by: gustavo.diaz@… Owned by: rjollos
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 4 years ago by rjollos

  • Status changed from new to assigned
  • Trac Release changed from 0.11 to 0.12

comment:2 Changed 4 years ago by rjollos

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 4 years ago by rjollos

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

comment:4 Changed 4 years ago by rjollos

  • Keywords needinfo added

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

comment:5 Changed 14 months ago by rjollos

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

Add Comment

Modify Ticket

Action
as 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.