diff options
author | Simon Schampijer <simon@laptop.org> | 2012-10-10 18:05:55 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2012-10-10 18:45:40 (GMT) |
commit | 3e8606cc3441465d64b0b1c7ddccb20977680e90 (patch) | |
tree | 7333cb851f45ba481fa2a9fbc20ffd5465efe262 | |
parent | 1cd8eb3af8f26cf98e1d62d676726f7bb3689905 (diff) |
Set default python encoding to utf-8
As spoted by Daniel Narvaez in [1], pygi does not set the default encoding
anymore as the old GTK+ did. This change does break activities ported
to GTK+3.
The change in GTK+ has been discussed upstream here [2].
A better solution will be implemented when we port to Python 3,
when we will be able to use real unicode strings.
The toolkit-gtk3 has already been fixed in
5fdad9481ba7079a6a718159ebe7eb8e5367c46e.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewed-by: Gonzalo Odiard <gonzalo@laptop.org>
[1] http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038993.html
[2] https://bugzilla.gnome.org/show_bug.cgi?id=681915
-rwxr-xr-x | bin/sugar-session | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/sugar-session b/bin/sugar-session index 42e7beb..7455f38 100755 --- a/bin/sugar-session +++ b/bin/sugar-session @@ -22,6 +22,11 @@ import time import subprocess import shutil +# Change the default encoding to avoid UnicodeDecodeError +# http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038928.html +reload(sys) +sys.setdefaultencoding('utf-8') + if os.environ.get('SUGAR_LOGGER_LEVEL', '') == 'debug': print '%r STARTUP: Starting the shell' % time.time() sys.stdout.flush() |