id summary reporter owner description type status priority milestone component version severity resolution keywords cc distribution status_field 1775 view source functionality should be more robust against buggy activities rgs tomeu "Scenario: We added view-source support to TurtleArt (see attached code snippet). I manage to hit a code path (a race condition somewhere or problem accessing the temp file) in which I got the following exception (in ~/.sugar/default/logs/shell.log): {{{ File ""/usr/lib/python2.6/dist-packages/jarabe/view/viewsource.py"", line 291, in __init__ activity_button.props.group = document_button UnboundLocalError: local variable 'document_button' referenced before assignment }}} Checking the constructor of the Toolbar class in jarabe/view/viewsource.py it seems like the following test: {{{ if document_path is not None: }}} forgets to check file existence as the previous conditional does: {{{ if document_path is not None and os.path.exists(document_path) }}} The attached patch proposes a fix by starting document_button to None which seems cheaper then testing for the existence of a file twice. " defect closed Unspecified by Maintainer Sugar Git as of bugdate Major fixed r+, robust file existence check walter Unspecified New