Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11504 closed defect (fixed)

AttributeError: 'NoneType' object has no attribute 'get_similar_commands'

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: admin/console Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fix an AttributeError from help command of trac-admin with non-existent environment and non-existent command.

API Changes:
Internal Changes:

Description

When running the command:

trac-admin $env help $cmd

the following output results for the case that $env is not a valid environment and $cmd is not a valid command:

$ trac-admin noenv help nocmd
No documentation found for 'nocmd'. Use 'help' to see the list of commands.
AttributeError: 'NoneType' object has no attribute 'get_similar_commands'

Prior to [12277], a different error would result:

$ trac-admin noenv help nocmd
No documentation found for 'nocmd'. Use 'help' to see the list of commands.
UnboundLocalError: local variable 'cmd_mgr' referenced before assignment

Thanks to Olemis Lang for initial investigating of the issue, which was reported in bloodhound:#762.

Attachments (0)

Change History (5)

comment:1 by Jun Omae, 10 years ago

Owner: set to Jun Omae
Status: newassigned

Thanks for investigating. Wrong handling with non-existent path on help command. I'll fix it.

comment:2 by Jun Omae, 10 years ago

Milestone: 1.0.20.12.6

Trac 0.12.4 and later have the same issue. That is introduced in [11165].

$ ~/venv/trac/0.12.5/bin/trac-admin /notfound help nocmd
No documentation found for 'nocmd'. Use 'help' to see the list of commands.
UnboundLocalError: local variable 'cmd_mgr' referenced before assignment
$ ~/venv/trac/0.12.4/bin/trac-admin /notfound help nocmd
No documentation found for 'nocmd'. Use 'help' to see the list of commands.
UnboundLocalError: local variable 'cmd_mgr' referenced before assignment
$ ~/venv/trac/0.12.3/bin/trac-admin /notfound help nocmd
No documentation found for 'nocmd'

comment:3 by Jun Omae, 10 years ago

Fix with unit tests in jomae.git@t11504 and jomae.git@t11504_0.12.6dev.

comment:4 by Jun Omae, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [12540] and merged in [12541-12542].

comment:5 by Ryan J Ollos, 10 years ago

The changes look good and test out well on my end. Thanks for the quick fix!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.