Ticket #8235 (assigned defect)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: gustavo.diaz@gmail.com Assigned to: rjollos (accepted)
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

Change History

12/03/10 00:45:10 changed by rjollos

  • release changed from 0.11 to 0.12.
  • status changed from new to assigned.

12/03/10 01:18:38 changed 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)

12/03/10 01:24:03 changed by rjollos

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

12/07/10 01:17:58 changed by rjollos

  • keywords set to needinfo.

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


Add/Change #8235 ([error] AttributeError: 'module' object has no attribute 'now')




Change Properties
Action