Closed Bug 1529077 Opened 9 months ago Closed 9 months ago

UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 110: ordinal not in range(128)

Categories

(Testing :: Marionette, defect, P2)

defect

Tracking

(firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

Details

Attachments

(2 files)

I noticed this failure by a typo in a test when I used a non-existent Marionette exception type. The last two frames of the stack look like:

  File "/Volumes/data/code/gecko/testing/marionette/harness/marionette_harness/runner/base.py", line 598, in gather_debug
    self.logger.warning('Failed to gather test failure debug: {}'.format(exc))

  File "/Volumes/data/code/gecko/testing/marionette/client/marionette_driver/errors.py", line 39, in __str__
    msg = str(self.message)

It fails because we are trying to log the following string with two Unicode characters:

Failed to gather test failure debug: Dismissed user prompt dialog: http://127.0.0.1:52040 is requesting your username and password. The site says: “secret”

Here str() in errors.py will fail.

Solution is to have a __str__() just as a wrapper around __unicode__().

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c446a23bf41
[marionette] Encode Unicode error messages as UTF-8. r=ato
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.