After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671261 - UnicodeDecodeError breaks the interface viewer
UnicodeDecodeError breaks the interface viewer
Status: RESOLVED FIXED
Product: accerciser
Classification: Applications
Component: general
3.3.x
Other Linux
: Normal normal
: ---
Assigned To: Accerciser Developers
Accerciser Developers
: 622537 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-03 16:47 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2012-05-26 21:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.63 KB, patch)
2012-05-16 09:37 UTC, Javier Hernández
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2012-03-03 16:47:17 UTC
Steps to reproduce:

1. Set language to Spanish
2. Launch Accerciser

Expected results: The interface viewer would be functional

Actual results: The interface viewer is not functional. And at least in my environment (admittedly unstable), crashes Accerciser when the selection changes in the interface viewer's combobox.

Traceback (most recent call last):
  • File "/usr/lib/python2.7/site-packages/accerciser/plugin/base_plugin.py", line 157 in __call__
    return self.func(*args, **kwargs)
  • File "/usr/share/accerciser/plugins/interface_view.py", line 65 in init
    _SectionAction(ui_xml, self.node),
  • File "/usr/share/accerciser/plugins/interface_view.py", line 171 in __init__
    self._setExpanderChildrenSensitive(False)
  • File "/usr/share/accerciser/plugins/interface_view.py", line 235 in _setExpanderChildrenSensitive
    elif _('(not implemented)') not in label_text:
  • File "/usr/lib/python2.7/site-packages/accerciser/plugin/base_plugin.py", line 157 in __call__
    return self.func(*args, **kwargs)
  • File "/usr/share/accerciser/plugins/interface_view.py", line 134 in onAccChanged
    for section_obj in self.sections:
  • File "/usr/lib/python2.7/site-packages/accerciser/plugin/base_plugin.py", line 123 in __getattribute__

Comment 1 Joanmarie Diggs (IRC: joanie) 2012-03-03 16:49:30 UTC
Oops, thought the errors were copied too. :-/ Sorry for the spam!

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)

Traceback (most recent call last):
  • File "/usr/lib/python2.7/site-packages/accerciser/plugin/base_plugin.py", line 157 in __call__
    return self.func(*args, **kwargs)
  • File "/usr/share/accerciser/plugins/interface_view.py", line 65 in init
    _SectionAction(ui_xml, self.node),
  • File "/usr/share/accerciser/plugins/interface_view.py", line 171 in __init__
    self._setExpanderChildrenSensitive(False)
  • File "/usr/share/accerciser/plugins/interface_view.py", line 235 in _setExpanderChildrenSensitive
    elif _('(not implemented)') not in label_text:
AttributeError: 'InterfaceViewer' object has no attribute 'sections'

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/accerciser/plugin/base_plugin.py", line 157, in __call__
    return self.func(*args, **kwargs)
  File "/usr/share/accerciser/plugins/interface_view.py", line 134, in onAccChanged
    for section_obj in self.sections:
  File "/usr/lib/python2.7/site-packages/accerciser/plugin/base_plugin.py", line 123, in __getattribute__
Comment 2 Javier Hernández 2012-03-04 22:52:22 UTC
Hi Joanie, thanks for your report!

I can't reproduce this problem in my devel environment. I'm using jhbuild under Fedora 16. My jhbuild environment was updated yesterday, and my interface viewer isn't causing these problems at all.

About the UnicodeDecode errors, I'm not having them, but just realized that some translations aren't working well. I'll investigate a little bit more about this issue.

I'm supposing that you're under a Fedora raw, but please, more information about your environment could help a little, like ie, your python version.

Thanks and regards!
Comment 3 Joanmarie Diggs (IRC: joanie) 2012-03-04 23:18:13 UTC
$ python
Python 2.7.2 (default, Jan  4 2012, 20:44:07) 
[GCC 4.7.0 20120103 (Red Hat 4.7.0-0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

It's a tad bigger than just the UnicodeDecodeError. It seems like your InterfaceViewer class's init() falls back on the widget label [1] for expanders of sections which do not subclass _InterfaceSection (like the Collection interface). When you are falling back on the label for the name in a non-English locale, you get the translated name (like colección). Then when you create the new section with the non-English interface name, you fail to get the expander [2].

BTW, I filed this bug because the Debian packager who is trying to include Accerciser 3.3 in a mostly 3.2 environment is running up against it. So perhaps you could try Accerciser master in Fedora 16 outside of jhbuild?

[1] http://git.gnome.org/browse/accerciser/tree/plugins/interface_view.py#n93
[2] http://git.gnome.org/browse/accerciser/tree/plugins/interface_view.py#n169
Comment 4 Balló György 2012-05-01 00:56:36 UTC
I confirm this bug on Arch Linux with Hungarian locale. Accerciser is totally unusable due this bug.

Tested with the latest 3.4.1 release with python 2.7.3.
Comment 5 Javier Hernández 2012-05-16 09:37:08 UTC
Created attachment 214172 [details] [review]
proposed patch

Hi all!

Here's a patch that should fix the problem. I added dummy implementations for some unimplemented interfaces and added a couple of unicode checks.

I tested it with English, Spanish and Hungarian language and all seem to work as expected. I tested with openSUSE 12.1 (which has Gnome 3.2).

More testing on different environments than openSUSE 12.1 will be very appreciated,

Cheers!!
Comment 6 Javier Hernández 2012-05-18 20:46:53 UTC
*** Bug 622537 has been marked as a duplicate of this bug. ***
Comment 7 Javier Hernández 2012-05-26 21:10:50 UTC
Review of attachment 214172 [details] [review]:

commited: 06b16a05d79e9664f4475d89dd7badae24bda62d