[Bugs] #4475 sugar UNSP: del of none-existant option entry causes controlpanel to crash

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Sat Mar 30 09:10:09 EDT 2013


#4475: del of none-existant option entry causes controlpanel to crash
------------------------------------------+---------------------------------
    Reporter:  walter                     |          Owner:  erikos                     
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  sugar                      |        Version:  Unspecified                
    Severity:  Unspecified                |       Keywords:                             
Distribution:  Unspecified                |   Status_field:  Unconfirmed                
------------------------------------------+---------------------------------
 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._options['power']
 + if 'power' in self._options:
 +     del self._options['power']

 and

 - del self._options['keyboard']
 + if 'keyboard' in self._options:
 +     del self._options['keyboard']

 Log attached

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/4475>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list