-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to Python 3 #844
Port to Python 3 #844
Conversation
I am not able to test the changes.
When I start sugar, it fails. When I check .sugar for logs, the |
I am getting this as a traceback on starting activities from Ubuntu terminal using
|
That traceback is in |
No, I got it when I tried to run the Chat activity from Ubuntu terminal, using Thanks! |
Thanks. That's not a common usage. No child is expected to do that. Only if activities fail to run in Sugar Terminal or from Sugar home view, list view, or sharing, would it be considered blocking. So I'll move back to your previous comment; Sugar does not start, and there are no logs. The cause must be uncovered. Any progress? |
Thanks, noted.
I have decided to first work on sugar-datastore Python 3 port, as sugar depends on it. We will not able to test the changes in sugar fairly until and unless we have all the dependencies working fine. What do you suggest? |
I don't think I need to prioritise Sugar vs Datastore. It's up to you. They are considerably different; the former is a GTK application, the latter is a D-Bus service. We have no other D-Bus services in our sources. However, Datastore could be run in Python 3 and tested against either a Python 2 or Python 3 Sugar, and vice versa. I don't think there should be any problem mixing Python versions across the D-Bus barrier. |
I am still not able to test these changes, Sugar does not start, Thanks! |
When you say Sugar does not start, what have you observed to conclude that? How are you starting Sugar? I suggest using
#!/bin/sh
strace -o /tmp/sugar.strace -f /usr/bin/sugar.real > /tmp/sugar.out 2> /tmp/sugar.err
|
I am trying to log in into the Sugar Desktop from Ubuntu login, when I press enter after typing the password, the cursor appears with a black screen, and nothing happens further.
Thanks, I will try that :-) |
Re: d501d7f. Heh. 😁 Now, is there something we can do to make it clearer that this has gone wrong? |
Your suggestion made me realise that actually sugar is being called from I have removed dependencies for Python 2 version for testing, that was the reason for the failure of sugar. Now I am able to start sugar. Observations:-
I got a traceback in the logs, regarding that 😅 @quozl this was the traceback
|
Thanks. Should you ever need to, rather than remove Sugar for Python 2, whatever calls But it's still odd that you got a black screen and nothing in logs for trying to start a Python 2 build of Sugar on the same system that contained a Do keep diagnosing why Journal, Neighbourhood and Group views are not working. |
Thanks.
Yes, I am working on it, @pro-panda your suggestions will be valuable here, as you instantiated these changes 😁 |
It could easily be something in the toolkit that isn't used by activities. I suggest instrumenting the Sugar code with logging and use an attached debugger to determine state of relevant objects. |
Thanks, currently I am looking at |
On Wed, Jul 10, 2019 at 09:44:18PM -0700, James Cameron wrote:
I suggest using strace. Read about the command in man strace. Then try
something like this;
• temporarily move /usr/bin/sugar to /usr/bin/sugar.real,
• add a shell script /usr/bin/sugar containing;
#!/bin/sh
strace -o /tmp/sugar.strace -f /usr/bin/sugar.real > /tmp/sugar.out 2> /tmp/sugar.err
• start Sugar once more; the results will be in those three files in /tmp
Optionally, and especially if you find yourself doing anything interactive at the shell, you can create a log of everything displayed in the terminal by wrapping your session with an instance of the script(1) command:
http://manpages.ubuntu.com/manpages/disco/en/man1/script.1.html
Directing specific output to specific files as above is the cleanest way to do it. You know which output came from STDOU (>), which from STDERR (2>), and which from strace (-o).
It does require more files, though, which can compound the difficulty of tracking what output corresponds with what iteration. Committing such ephemeral output files to version control isn't really appropriate, but one needs some way of distinguishing, for instance, output from before a change was made versus output after a change was made. I often will indicate the before/after origins of the output by changing the filenames.
When there are multiple filenames like this, I all too often neglect to change one of them to match the others, instead overwriting a file from a previous run. So, the output is more muddled, but I find it more tractable to have just one file per run, recorded with the 'script' command. One thing to be very careful of, though: If you interactively start recording with script, be sure to 'exit' out of the subshell to close out the logfile, or it will grow huge!
Another approach to normalizing your filenames across trials for ephemeral output like this is to datestamp the filenames.
For instance, here I append the number of seconds since the epoch to each filename:
strace -o /tmp/sugar.strace-$(date +%s) -f /usr/bin/sugar.real > /tmp/sugar.out-$(date +%s) 2> /tmp/sugar.err-$(date +%s)
Finally, another approach to keep the output from multiple runs separate is to put the results from each run in its own directory. This has a similar drawback as using multiple files per run, though, in that you have to be particularly mindful of your working directory all the time lest you inadvertently overwrite results from a previous iteration.
Another way to look at this might be: If you have reproducible behavior that you would like to document and communicate to others, use redirects. For internal, interactive use, where you're not yet sure what's happening, where, or why, it's better to have *some* log than a perfect log, and so you might find 'script' handy.
Hope that helps,
…--
D. Joe
|
Thanks Joe! Another way to get logs from early failure of |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Testing configuration~
Observations~
Issue~
Note~ Thanks! |
Thanks, good progress. |
@quozl @pro-panda I am not able to figure out how to fix it, as a work around I looked into the files of sugar and datastore having the keyword |
Please describe the symptom? Of particular interest will be (a) the user operations that lead up to the event, (b) the value shown in the second last column of the Journal, and (c) the value shown in the "Date" field of the detailed view of the journal object. For instance; (a) open Write activity, stop, open Journal, show detailed view, (b) "Seconds ago", and (c) "Date: 17/07/19". |
Open and close any activity, creating an instance in journal.
"0 years ago"
By this did you mean detail view of an activity instance in journal? Sorry it's not clear to me. Thanks. |
It's a fault in the toolkit. Watch me test by hand;
vs
|
Yes. You'll probably find no issue with the date shown there. |
Thanks. Made a fix in sugarlabs/sugar-toolkit-gtk3#420, please test. |
Tested and merged. Has this pull request now reached full functionality? |
Thanks.
Yes. I tested the changes from my side, It will be really good if you test again. 😁 |
@pro-panda it will be great if you also review and test it. :-) |
Can't test, because can't resolve dependencies, because there's no package python3-gwebsockets yet. |
Yes agreed, I am still working on it. Thanks. |
@pro-panda @quozl May you please test this pr now? |
Given the complexity of native install, and the difficulty others have had in reproducing the work so far, we really should try for packages. How is progress on toolkit packages for Python 3? |
* remove call to sys.setdefaultencoding default encoding is 'utf-8' by default in Python 3 * remove use of statvfs statvfs does not exist in python 3 * TODO was fixed in af6ce2e * Remove unused function * flake fixes * Fix unicode encoding error * Use a list to iterate over, supporting Python 3 * Encode 'str' instance into 'utf-8' Co-authored-by: Aniket21mathur <[email protected]>
Although testing is incomplete, there's other pull requests coming into Sugar that need to be based off this work. |
Replaces #805