Open
Conversation
…closes When running Sugar from a terminal and the window is closed, the terminal sends a SIGHUP signal. This change adds a signal handler for both SIGHUP and SIGTERM that calls Gtk.main_quit() to ensure Sugar exits cleanly. The handler is registered after desktop startup begins and before entering the GTK main loop.
- Add _is_python2_activity() helper function to detect Python 2 activities - Check activity command in launch() function before attempting to start - Display user-friendly alert dialog explaining incompatibility - Log error message when Python 2 activity launch is attempted - Prevent silent failures by blocking launch of incompatible activities Python 2 activities are identified by their use of 'sugar-activity' command (without '3' suffix), as opposed to Python 3 activities which use 'sugar-activity3' or 'sugar-activity-web'. Fixes sugarlabs#991
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements detection and warning for Python 2 activities attempting to run on Python 3 Sugar systems.
Problem
Fixes #991 - Sugar on Python 3 platforms does not detect Python 2 activities. These activities install successfully but fail to start with no error messages in logs, creating a confusing user experience.
Solution
_is_python2_activity()helper function to identify Python 2 activities by checking theexeccommand in their activity.info filelaunch()function insrc/jarabe/journal/misc.pyto check for Python 2 activities before attempting to launchTechnical Details
Python 2 activities are identified by their command field:
exec = sugar-activity(without '3' suffix)exec = sugar-activity3orexec = sugar-activity-webThe detection happens in the
launch()function which is called from multiple places including:src/jarabe/journal/bundlelauncher.pysrc/jarabe/desktop/favoritesview.pysrc/jarabe/journal/journalactivity.pyChanges Made
File modified:
src/jarabe/journal/misc.py_is_python2_activity()helper function (lines 51-70)launch()function (lines 284-302)Testing
To test this fix:
exec = sugar-activityin activity.info)Benefits