Opened 16 years ago
Closed 16 years ago
#3604 closed defect (fixed)
from trac.util import sorted in admin.py faild
Reported by: | Jay Xie | Owned by: | Matt Good |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I installed the trunk version of acct_mgr in trac_0.12dev, but only notification panel is shown under the accounts area in admin page.
And in the log I saw 'Trac[loader] ERROR: Skipping "acct_mgr.admin = acct_mgr.admin": (can't import "cannot import name sorted")'.
I think this is problem. So I commented line 17 in admin.py "from trac.util import sorted" and that seems to work.
I don't know if this will cause other problem, so please fix it. Thanks.
Attachments (0)
Change History (3)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
A few functions defined in trac.util.compat
for Python 2.3 compatibility were removed in trunk as 2.3 support was dropped. I re-added the symbols in [T7551] to avoid the problem described here.
The obsolete import should still be removed in the (future) 0.12 version.
trac.util.sorted was located in trac/util/compat.py in versions < 0.12
built-in function
sorted
was added in python-2.4IIRC, trac-0.12 is not compatible with python < 2.5
So, better way to keep backward compatibility is to provide own compat realization of sorted function. In fresh versions, it's quite safe to drop import statement.