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 783141 - Search does not work in Tweak Tool
Search does not work in Tweak Tool
Status: RESOLVED FIXED
Product: gnome-tweak-tool
Classification: Applications
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-05-27 02:43 UTC by Jeremy Bicha
Modified: 2017-06-05 12:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tweakmodel: Factor out a function to prepare strings for searching (2.56 KB, patch)
2017-05-29 16:57 UTC, Rui Matos
committed Details | Review

Description Jeremy Bicha 2017-05-27 02:43:49 UTC
gnome-tweak-tool 3.24.0
Ubuntu 17.04 and Fedora 26

Run gnome-tweak-tool from a terminal. Click the Search button and try to search. This appears in the terminal:

Traceback (most recent call last):
  • File "/usr/lib/python2.7/dist-packages/gtweak/tweakview.py", line 248 in _on_search
    tweaks, group = self._model.search_matches(txt)
  • File "/usr/lib/python2.7/dist-packages/gtweak/tweakmodel.py", line 158 in search_matches
    if t.search_matches(txt):
  • File "/usr/lib/python2.7/dist-packages/gtweak/tweakmodel.py", line 61 in search_matches
    self.description.decode("utf-8","ignore").lower()
  • File "/usr/lib/python2.7/encodings/utf_8.py", line 16 in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 101: ordinal not in range(128)

Comment 1 Rui Matos 2017-05-29 16:57:39 UTC
Created attachment 352801 [details] [review]
tweakmodel: Factor out a function to prepare strings for searching

And use the GLib utf-8 APIs instead of Python's since those are just
confusing.
Comment 2 Jeremy Bicha 2017-05-29 17:33:21 UTC
Your patch fixes the problem for me. Thanks!
Comment 3 Rui Matos 2017-05-30 10:25:51 UTC
Attachment 352801 [details] pushed as 692dbde - tweakmodel: Factor out a function to prepare strings for searching
Comment 4 Jeremy Bicha 2017-06-05 02:40:25 UTC
Do you want to push this to gnome-3-24 too?
Comment 5 Rui Matos 2017-06-05 12:51:09 UTC
Thanks for the reminder

35cf208..72dd259  gnome-3-24 -> gnome-3-24