Modify

Opened 6 years ago

Closed 4 years ago

#4849 closed defect (duplicate)

"NameError: global name 'sorted' is not defined" after clicking "Users"

Reported by: silverblood Owned by: hasienda
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords: NameError Users
Cc: Trac Release: 0.11

Description

after clicking "Users" in the admin tab, a "NameError: global name 'sorted' is not defined" is received. this would seem to be an issue related to python 2.3 compatibility.

my solution was to edit acct_mgr/admin.py and replace the line:

from trac.util import sorted

with:

from trac.util.compat import set, sorted

and rebuild the egg.

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by silverblood

a better version of the above fix that still seems to work correctly, but not fully tested as I lack a way to test with a newer version of python.

try:
	from trac.util import sorted
except ImportError:
	from trac.util.compat import set, sorted

comment:2 follow-up: Changed 4 years ago by hasienda

  • Owner changed from pacopablo to hasienda

As in recent Trac versions trac/util/init module sorted is imported from trac/util/compat.py, this is certainly a valid assertion.

comment:3 in reply to: ↑ 2 Changed 4 years ago by hasienda

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

Replying to hasienda:

As in recent Trac versions trac/util/init module sorted is imported from trac/util/compat.py, this is certainly a valid assertion.

Meant 'trac/util/__init__', but despite of the much better report quality this is still a duplicate of ticket #4830.

Add Comment

Modify Ticket

Action
as 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.