Edgewall Software

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' — at Version 4

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.

Change History (4)

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].

Note: See TracTickets for help on using tickets.