[Sugar-devel] [sugar-toolkit-gtk3] Set default python encoding to utf-8

S. Daniel Francis francis at sugarlabs.org
Fri Sep 14 15:43:57 EDT 2012


I'd say: +1 to your change

2012/9/14 Gonzalo Odiard <gonzalo at laptop.org>:
> This patch is not included and haven't received comments.
> Any particular reason?
> There are ported activities needing this change.
>
> Gonzalo
>
>
> On Mon, Aug 27, 2012 at 11:09 AM, <godiard at sugarlabs.org> wrote:
>>
>> From: Gonzalo Odiard <godiard at gmail.com>
>>
>> As spoted by Daniel Narvaez in [1], pygi does not set the default encoding
>> anymore as the old gtk did. This change break ported activities.
>> The change in gtk was 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.
>>
>> Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
>>
>> [1] http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038993.html
>> [2] https://bugzilla.gnome.org/show_bug.cgi?id=681915
>> ---
>>  bin/sugar-activity | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/bin/sugar-activity b/bin/sugar-activity
>> index 5aef1ae..839174a 100644
>> --- a/bin/sugar-activity
>> +++ b/bin/sugar-activity
>> @@ -18,6 +18,11 @@
>>
>>  import os
>>  import sys
>> +# Change the default encoding to avoid UnicodeDecodeError
>> +# http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038928.html
>> +reload(sys)
>> +sys.setdefaultencoding('utf-8')
>> +
>>  import gettext
>>  from optparse import OptionParser
>>
>> --
>> 1.7.11.2
>>
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>


More information about the Sugar-devel mailing list