Opened 15 years ago
Closed 15 years ago
#9059 closed defect (fixed)
Error in trac-admin env upgrade - AttributeError: 'Environment' object has no attribute 'env'
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | high | Milestone: | 0.12 |
Component: | admin/console | Version: | 0.12dev |
Severity: | trivial | Keywords: | env.py transaction |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
It is now imposible to upgrade trac environment, due to the aforementioned error.
Stack trace is:
2010-02-15 16:11:15,448 Trac[console] ERROR: Exception in trac-admin command: Traceback (most recent call last): File "build/bdist.linux-i686/egg/trac/admin/console.py", line 107, in onecmd rv = cmd.Cmd.onecmd(self, line) or 0 File "/usr/lib/python2.6/cmd.py", line 218, in onecmd return self.default(line) File "build/bdist.linux-i686/egg/trac/admin/console.py", line 251, in default return cmd_mgr.execute_command(*args) File "build/bdist.linux-i686/egg/trac/admin/api.py", line 118, in execute_command return f(*fargs) File "build/bdist.linux-i686/egg/trac/env.py", line 745, in _do_upgrade self.env.upgrade(backup=no_backup is None) File "build/bdist.linux-i686/egg/trac/env.py", line 491, in upgrade @with_transaction(self.env) AttributeError: 'Environment' object has no attribute 'env'
This was probably introduced with improvement of transaction handling in changeset r9183.
Attachments (1)
Change History (5)
comment:1 by , 15 years ago
Cc: | removed |
---|---|
Description: | modified (diff) |
Owner: | set to |
Severity: | critical → trivial |
by , 15 years ago
Attachment: | env.py.diff added |
---|
The patch that fixes erroneous behavior describe above. (self.env changed to self)
comment:2 by , 15 years ago
I actually don't write Python at all… Anyway, the above works for me - was able to update. Thanx for quick response.
comment:3 by , 15 years ago
In env.py.diff, the second change is wrong. The EnvironmentSetup class is a Component, and therefore its instances have a self.env
property which is the appropriate, owning, Environment instance. That mistake is not harmful until you'll create a new environment, so you'd better revert that change.
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Can you please try the following fix:
trac/env.py
.env)(and no need to CC: me, I get notified of all the changes anyway ;-) )