Skip to content

Commit

Permalink
Fix an exception when searching for a bug ID
Browse files Browse the repository at this point in the history
The encode() function returns 'bytes' but that is useless and wrong in
our case, because we just need to get 'str' from 'DBus.String' to be
able to call the 'in' operator (the operator does not work for 'str' in
'DBus.String').

Related: rhbz#1211083, rhbz#1242080

Signed-off-by: Jakub Filak <jfilak@redhat.com>
  • Loading branch information
Jakub Filak committed Jul 13, 2015
1 parent 796ac63 commit 9ed78be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gnome_abrt/views.py
Expand Up @@ -105,7 +105,9 @@ def match(self, list_box_row):
if problems.Problem.Submission.URL != sbm.rtype:
continue

rid = sbm.data.encode('utf-8')
# _pattern is 'str' and sbm.data is 'dbus.String', so we need
# to convert sbm.data to a regular 'str'
rid = str(sbm.data)
rid = rid.rstrip('/').split('/')[-1].split('=')[-1]
if self._pattern in rid:
return True
Expand Down

0 comments on commit 9ed78be

Please sign in to comment.