Re: gnome-tweak-tool fails to install extension from zip with UnicodeDecodeError



On Thu, May 24, 2012 at 7:09 AM, Amy C <mathematical coffee gmail com> wrote:
> Ok, I have narrowed this down further.
>
> I believe there *is* a bug in gnome-tweak-tool
> (tweak_shell_extensions.py) to do with installing an extension from a
> .zip file. The error is being raised from Python:
>> Traceback (most recent call last):
>>  File
>> "/usr/lib/python2.7/dist-packages/gtweak/tweaks/tweak_shell_extensions.py",
>> line 115, in _on_file_set
>>   verb = _("%s extension updated successfully") % extension_uuid
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 4
>> ordinal not in range(128)

This is gnome-tweak-tool's fault. extension_uuid is a unicode string.
Ned Batchelder gave a good talk on why this happens[0].

> I cannot reproduce this myself because my locale is 'en_AU.utf8' and I
> am having trouble changing it, but the person trying to install my
> extension that I am corresponding this can reproduce by
> 1) install an extension from e.g.o (this works fine);
> 2) zip it up
> 3) uninstall it (remove key with dconf-editor, remove directory,
> restart gnome-shell)
> 3) try to install it from a zip file: the UnicodeDecodeError.
>
> Their locale is pl_PL.utf8. (It could be something to do with their
> particular settings as opposed to a bug, too).
>
> Extensions *can* be installed from e.g.o & manually via putting the
> folder in .local/share/gnome-shell/extensions & modifying
> dconf-editor.
>
> (My particular extension was not working via this method because it
> had an additional error, a missing dependency).
>
> I'm not sure how to go about further "debugging" this (if it is in
> fact a bug) as I am unable to reproduce, but I did find various bug
> reports [1] that suggest it can be solved via `export LANG=en.UTF-8`.
>
> My guess is it is something to do with the gettext/translations/locale
> (I don't know enough to narrow it down further, but I thought I'd
> clarify my previous email).
>
> cheers.
> [1]: https://bugs.launchpad.net/bzr/+bug/813917
>
> On Thu, May 24, 2012 at 2:50 PM, Amy C <mathematical coffee gmail com> wrote:
>> Hi all,
>>
>> I've written a small extension that adds minimise, maximise, always on
>> top, etc to the title button on the top panel (Main.panel._appMenu).
>> I have someone trying to install it through gnome-tweak-tool (on GNOME
>> 3.2.2.1) via 'Shell Extensions' -> 'install extension (from zip file)'
>> -> select the .zip of the extension.
>>
>> When they do this they get the following error (discovered by running
>> gnome-tweak-tool from the terminal):
>>
>> INFO    : Extracted zip to
>> /tmp/tmpd9mfyo/window-options mathematical coffee gmail com, copied to
>> /home/anon/.local/share/gnome-shell/extensions/window-options mathematical coffee gmail com
>> WARNING : Error parsing theme zip
>> Traceback (most recent call last):
>>  File
>> "/usr/lib/python2.7/dist-packages/gtweak/tweaks/tweak_shell_extensions.py",
>> line 115, in _on_file_set
>>   verb = _("%s extension updated successfully") % extension_uuid
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 4
>> ordinal not in range(128)
>>
>> I initially thought this was a problem with my extension, but now I
>> think that this *particular* problem is to do with gnome-tweak-tool or
>> python or something (although who knows, there are probably still
>> mistakes in my extension too). I think this because I notice the error
>> is occuring in the "extension updated successfully" part of the
>> gnome-tweak-tool code as opposed to an error with the extension
>> itself.
>>
>> The locale for this user is 'pl_PL.utf8'. Mine is 'en_AU.utf8' and I
>> can install the extension fine. I cannot reproduce this error as all
>> my attempts to change my locale so far have failed (even using the
>> system settings - when I log out & try to log in it does have some
>> Polish word for 'Password' (I assume) but then once I'm actually
>> logged in everything reverts back to english and typing `locale` gives
>> me en_AU.utf8 again).
>>
>> How can I help this user install the extension, or at least determine
>> whether it's my extension with the problem or something else?
>> The user has also tried copying the folder to
>> ~/.local/gnome-shell/extensions & modifying
>> /org/gnome/shell/enabled-extensions to add the extension, and then it
>> shows up in gnome-tweak-tool but with an orange exclamation mark next
>> to it. This seems to indicate to me that there's something wrong with
>> my extension, but it is working fine on my GNOME 3.2.2.1 & GNOME 3.4
>> computers (all of which are en_AU.utf8).
>>
>> I have asked the user to make a .zip of one of their already-working
>> extensions and try install it in the same way to see if there's a
>> similar error.
>>
>> If anyone wants to give this a go, the extension can be downloaded
>> from the 'Downloads' page here:
>> https://bitbucket.org/mathematicalcoffee/window-options-gnome-shell-extension
>> . Pick the .zip file from the 'Downloads' page as this is the version
>> that the user is having trouble with.
>>
>> (I do want to eventually put the extension on e.g.o, but only when my
>> confidence in it has raised a little. i.e. when this problem is
>> resolved!)
>>
>> cheers.
> _______________________________________________
> gnome-shell-list mailing list
> gnome-shell-list gnome org
> https://mail.gnome.org/mailman/listinfo/gnome-shell-list

[0] http://nedbatchelder.com/text/unipain.html

-- 
  Jasper


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]