we don't properly encode/decode matchers values to utf-8

Bug #1207116 reported by Chris Gagnon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot
Fix Released
Undecided
Unassigned
autopilot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Description:
we don't properly encode values in autopilot/matchers

we should check the type of new_value or expected_value in autopilot/introspection/dbus.py's wait_for function and encode/decode to utf8 based on type (ie you can't encode string "阿布从" for example)

example of failing test from https://bazaar.launchpad.net/~brandontschaefer/unity/lp.1203106-fix/view/head:/tests/autopilot/unity/tests/test_ibus.py:

======================================================================
ERROR: unity.tests.test_ibus.IBusTestsPinyin.test_pinyin(hud,basic)
----------------------------------------------------------------------
_StringException: traceback-1: {{{
Traceback (most recent call last):
  File "/home/marco/Dev/unity/trunk/tests/autopilot/unity/tests/test_ibus.py", line 240, in test_pinyin
    self.do_ibus_test()
  File "/home/marco/Dev/unity/trunk/tests/autopilot/unity/tests/test_ibus.py", line 215, in do_ibus_test
    self.assertThat(widget.search_string, Eventually(Equals(result)))
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 406, in assertThat
    mismatch = matcher.match(matchee)
  File "/usr/lib/python2.7/dist-packages/autopilot/matchers/__init__.py", line 111, in match
    return Mismatch(str(e))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 77-79: ordinal not in range(128)
}}}

Related branches

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:autopilot at revision 305, scheduled for release in autopilot, milestone 1.3.2

Changed in autopilot:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopilot - 1.3.1+13.10.20130808-0ubuntu1

---------------
autopilot (1.3.1+13.10.20130808-0ubuntu1) saucy; urgency=low

  [ chris.gagnon ]
  * convert strings in dbus introspection waitfor function to unicode,
    use unicode(e) when returning a mismatch instead of str(e). (LP:
    #1207116)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 305
 -- Ubuntu daily release <email address hidden> Thu, 08 Aug 2013 00:01:11 +0000

Changed in autopilot (Ubuntu):
status: New → Fix Released
Changed in autopilot:
status: Fix Committed → Fix Released
milestone: none → 1.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.