Modify

Opened 9 years ago

Closed 9 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 9 years ago by anonymous

trac.util.sorted was located in trac/util/compat.py in versions < 0.12

built-in function sorted was added in python-2.4

IIRC, 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.

comment:2 Changed 9 years ago by Remy Blank

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.

comment:3 Changed 9 years ago by John Hampton

Resolution: fixed
Status: newclosed

Fixed in [4640]

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matt Good.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.