Modify

Opened 6 years ago

Closed 6 years ago

#3604 closed defect (fixed)

from trac.util import sorted in admin.py faild

Reported by: jay.w.xie@… Owned by: mgood
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 6 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 6 years ago by rblank

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 6 years ago by pacopablo

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [4640]

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from mgood. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.