Opened 11 years ago
Closed 10 years ago
#4475 closed defect (fixed)
del of none-existant option entry causes controlpanel to crash
Reported by: | walter | Owned by: | erikos |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | Unspecified |
Component: | Sugar | Version: | Unspecified |
Severity: | Unspecified | Keywords: | |
Cc: | Distribution/OS: | Unspecified | |
Bug Status: | Unconfirmed |
Description
Ignacio stumbled across this problem with the Sugar control panel. Using sugar-emulator on F18 (perhaps with some missing dependency) sr/jarabe/controlpanel/gui.py crashes when trying to delete 'power' from self._options when it is not present. Same is true for 'keyboard'.
With the proper dependencies (sugar-cp and xklavier) loaded, the problem goes away. But the code could be more robust.
A simple solution would be to add a check before del, e.g.,
- del self._optionspower?
+ if 'power' in self._options:
+ del self._optionspower?
and
- del self._optionskeyboard?
+ if 'keyboard' in self._options:
+ del self._optionskeyboard?
Log attached
Attachments (1)
Change History (2)
Changed 11 years ago by walter
comment:1 Changed 10 years ago by dnarvaez
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
I suspect this is now fixed because the xklavier stuff has been made non-optional. It will fail at the import if you don't have xklavier installed but I think that's the right thing do. IMO better to fail hard when something is wrong that to sort of work, hence I don't think the None check would have been a good idea anyway.