#1710 closed defect (fixed)
problems when trying to upgrade trac
Reported by: | anonymous | Owned by: | Colin Guthrie |
---|---|---|---|
Priority: | normal | Component: | WorkLogPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
Work Log needs an upgrade Upgrading Database Creating work_log table Upgrading usermanual Command faild: 'builtin_function_or_method' object has no attribute 'time'
Attachments (0)
Change History (10)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
I also have this same error:
Worklog needs an upgrade Upgrading usermanual Command failed: 'builtin_function_or_method' object has no attribute 'time'
comment:3 Changed 17 years ago by
Hi Tomek,
Can you check to see if the test program above in comment 1 works?
Also can you give me info about your Python and Trac versions?
comment:4 Changed 17 years ago by
Python 2.4.4 (#2, Apr 5 2007, 20:11:18) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> print int(time.time()) 1183452962 >>>
Trac 0.10.3
comment:5 Changed 17 years ago by
Thanks for that.
I don't understand why there is an issue :(
The error you get (updating the usermanual) if from a section that uses the the time function exactly like this!
Really odd. Can you edit the line which says when = int(time.time())
in api.py and change it to when = 1183452962
and see if things work then? If so then I'm even more confused!
PS I'm not a particularly great Python coder... this is my first attempt at python code, so still don't really know how the language works - mostly monkey see, monkey do at the moment!
comment:7 Changed 17 years ago by
I've changed the when = int(time.time())
to when = int(time())
and it works fine now.
comment:8 Changed 17 years ago by
Cool :)
Just a check tho'. If it worked one time, then it wouldn't actually run a second time so your second test may not be conclusive!
Hopefully this works:
from time import time print int(time())
I'll commit this change to SVN and then it should work.
It's odd that something on the command line that works for you, doesn't work when running trac-admin :(
Anyway, hopefully this is fixed.
comment:9 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:10 Changed 17 years ago by
(In [2427]) Reverts r2367. Refs #1710. Revert the time change code I put in as now this breaks it for me on my test system. I do not understand why this is a problem as the exact same code is used in Trac itself (see attachment.py). Please reopen if this remains an issue (note that it may require a clean install)
What version of Python are you using?
From what I can gather there is a problem with the
time.time()
call afterimport time
.Works fine for me here with Python 2.5.
Can you try this in a file (call it test.py):
And run it via cmd line with
python test.py
.It should just print out a number (of seconds since Jan 1st 1970) and should not error out.
Thanks