New issue
Advanced search Search tips

Issue 827502 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[wpt import] UnicodeEncodeError in the auto-notification code

Project Member Reported by raphael....@intel.com, Mar 30 2018

Issue description

From https://ci.chromium.org/buildbot/chromium.infra.cron/wpt-importer/14873:

Traceback (most recent call last):
  File "/mnt/data/b/rr/tmpyEpIa5/w/src/third_party/WebKit/Tools/Scripts/wpt-import", line 24, in <module>
    main()
  File "/mnt/data/b/rr/tmpyEpIa5/w/src/third_party/WebKit/Tools/Scripts/wpt-import", line 17, in main
    host.exit(importer.main())
  File "/mnt/data/b/rr/tmpyEpIa5/w/src/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py", line 178, in main
    if not self.send_notifications(local_wpt, options.auto_file_bugs, options.monorail_auth_json):
  File "/mnt/data/b/rr/tmpyEpIa5/w/src/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py", line 644, in send_notifications
    dry_run=not auto_file_bugs, service_account_key_json=monorail_auth_json)
  File "/mnt/data/b/rr/tmpyEpIa5/w/src/third_party/WebKit/Tools/Scripts/webkitpy/w3c/import_notifier.py", line 71, in main
    bugs = self.create_bugs_from_new_failures(wpt_revision_start, wpt_revision_end, gerrit_url)
  File "/mnt/data/b/rr/tmpyEpIa5/w/src/third_party/WebKit/Tools/Scripts/webkitpy/w3c/import_notifier.py", line 187, in create_bugs_from_new_failures
    commit_list = self.format_commit_list(imported_commits, full_directory)
  File "/mnt/data/b/rr/tmpyEpIa5/w/src/third_party/WebKit/Tools/Scripts/webkitpy/w3c/import_notifier.py", line 218, in format_commit_list
    line = '{}: {}'.format(subject, GITHUB_COMMIT_PREFIX + sha)
UnicodeEncodeError: 'ascii' codec can't encode character u'\U0001f38a' in position 22: ordinal not in range(128)
step returned non-zero exit code: 1

Which was caused by the emoji in https://github.com/w3c/web-platform-tests/commit/e343b5de16
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0a0af3cd9785ee63786d13c8444822cf99514bec

commit 0a0af3cd9785ee63786d13c8444822cf99514bec
Author: Robert Ma <robertma@chromium.org>
Date: Thu Apr 05 23:19:27 2018

[WPT Import] Handle Unicode commit subjects correctly

Use a Unicode template string for formatting commit lists, because the
commit subjects can contain non-ASCII characters (and they are Unicode
strings because the underlying host.executive automatically decodes the
subprocess outputs by default).

There are definitely other places that might break when seeing non-ASCII
characters, but nothing can be found around here.

By the way, MockExecutive is changed to match Executive more closely:
run_command now decodes the output and returns a Unicode string by
default. This change isn't required to fix the bug, and doesn't catch
other bugs for now, but hopefully it might be useful in the future.

Bug:  827502 
Change-Id: Ib46bfe4cc18d23c2298dfd44bb6ab907dd83e987
Reviewed-on: https://chromium-review.googlesource.com/998676
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Robert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548608}
[modify] https://crrev.com/0a0af3cd9785ee63786d13c8444822cf99514bec/third_party/WebKit/Tools/Scripts/webkitpy/common/system/executive_mock.py
[modify] https://crrev.com/0a0af3cd9785ee63786d13c8444822cf99514bec/third_party/WebKit/Tools/Scripts/webkitpy/w3c/import_notifier.py
[modify] https://crrev.com/0a0af3cd9785ee63786d13c8444822cf99514bec/third_party/WebKit/Tools/Scripts/webkitpy/w3c/import_notifier_unittest.py

Status: Fixed (was: Available)
 Issue 807678  has been merged into this issue.

Sign in to add a comment