Help crashes if specified plugin does not exist
Metadata
Current evaluation
Fixed an UnboundLocalError crash when running snapcraft help with a non-existent plugin. Resolved by properly handling missing module references in help.py.
Suggested action: —
No scores available.
Issue body
daniel@daydream:~/dev/snappy/snapcraft$ ./bin/snapcraft help plugin
The plugin does not exist. Use one of the following:
ant
autotools
catkin
cmake
copy
go
jdk
make
maven
python2
python3
qml
roscore
scons
tar-content
Traceback (most recent call last):
File "./bin/snapcraft", line 33, in <module>
snapcraft.main.main()
File "/home/daniel/dev/snappy/snapcraft/snapcraft/main.py", line 115, in main
args.func(args)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/help.py", line 50, in topic
_module_help(args.topic, args.devel)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/help.py", line 68, in _module_help
if module.__doc__ and devel:
UnboundLocalError: local variable 'module' referenced before assignment
daniel@daydream:~/dev/snappy/snapcraft$
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Fixed an UnboundLocalError crash when running snapcraft help with a non-existent plugin. Resolved by properly handling missing module references in help.py. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed an UnboundLocalError crash in snapcraft help when specifying a non-existent plugin. The bug was resolved by properly initializing the module variable before use. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed an UnboundLocalError in the help command that crashed when specifying a non-existent plugin. The bug was resolved by correcting the variable scope in help.py to properly handle missing plugin modules. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #13 Help crashes if specified plugin does not exist | snapcraft | closed | Fixed an UnboundLocalError crash in snapcraft help when requesting help for a non-existent plugin. The maintainer confirmed the traceback is resolved and closed the issue. | |
| #5169 snapcraft help fails on many commands | snapcraft | closed | Fixed a crash in snapcraft help caused by missing help text for certain arguments, triggering an IndexError in craft_cli. Resolved in PR #5178 and released in snapcraft 8.5.1. |