Bug 3180 - dogtail crashes with a UnicodeDecodeError: "'utf8' codec can't decode byte ..." error when running example
Summary: dogtail crashes with a UnicodeDecodeError: "'utf8' codec can't decode byte .....
Status: NEW
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks: 2777
  Show dependency treegraph
 
Reported: 2006-09-06 21:03 UTC by Andrew Cagney
Modified: 2006-11-28 16:45 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2006-09-06 21:03:28 UTC
From: http://bugzilla.gnome.org/show_bug.cgi?id=354515

Opened by Phil Muldoon (reporter, points: 3)
2006-09-05 20:53 UTC [reply]

Steps to reproduce:
1. Fedora Rawhide
2. python gedit-test-utf8-procedural-api.py
3. 


Stack trace:
[pmuldoon@dhcp-199 examples]$ python gedit-test-utf8-procedural-api.py 
Creating logfile at
/tmp/dogtail/logs/gedit-test-utf8-procedural-api_20060905-155027 ...
Detecting distribution: Red Hat/Fedora/derived distribution
GTK Accessibility Module initialized
Bonobo accessibility support initialized
Traceback (most recent call last):
  File "gedit-test-utf8-procedural-api.py", line 30, in ?
    run('gedit')
  File "/usr/lib/python2.4/site-packages/dogtail/procedural.py", line 310, in
run
    focus.application(application)
  File "/usr/lib/python2.4/site-packages/dogtail/procedural.py", line 57, in
__call__
    app = self.desktop.findChild(predicate, recursive = False, retry = False)
  File "/usr/lib/python2.4/site-packages/dogtail/tree.py", line 845, in
findChild
    result = findFirstChildSatisfying(self, pred, recursive)
  File "/usr/lib/python2.4/site-packages/dogtail/tree.py", line 817, in
findFirstChildSatisfying
    if child.satisfies(pred):
  File "/usr/lib/python2.4/site-packages/dogtail/tree.py", line 685, in
satisfies
    return pred.satisfiedByNode(self)
  File "/usr/lib/python2.4/site-packages/dogtail/predicate.py", line 95, in
satisfiedByNode
    return node.roleName=='application' and stringMatches(self.appName,
node.name)
  File "/usr/lib/python2.4/site-packages/dogtail/predicate.py", line 13, in
stringMatches
    return scriptName.matchedBy(reportedName)
  File "/usr/lib/python2.4/site-packages/dogtail/i18n.py", line 160, in
matchedBy
    return stringsMatch(self.untranslatedString, string)
  File "/usr/lib/python2.4/site-packages/dogtail/i18n.py", line 140, in
stringsMatch
    outString = outString.decode('utf-8')
  File "/usr/lib/python2.4/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa8 in position 0:
unexpected code byte


Other information:
We first noticed this when the frysk dogtail test suite crashed on rawhide:

The offending code (tree.root.application ....)

   # Start up Frysk 
    run ( FryskBinary, appName=FRYSK_APP_NAME )
    fryskObject = tree.root.application ( FRYSK_APP_NAME )

Crashed at that point. Checked sanity of FRYSK_APP_NAME turns out fine. However
using the AT-SPI sniff tool in the Programming -> AT_SPI Browser menu reveals
some applications with some odd names. One was named ?#? and others. I can
affix a screenshot if you need it. Sanity checked with the examples. It seems
when dogtail walks the tree, badly encoded strings cause it to crash.
Comment 1 Andrew Cagney 2006-09-06 21:04:58 UTC
Red Hat tracker:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=205461