Closed Bug 1567252 Opened 6 years ago Closed 5 years ago

moz-phab patch fails on windows with UnicodeDecodeError due to unicode characters in the name

Categories

(Conduit :: moz-phab, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emilio, Assigned: emilio)

References

Details

(Keywords: conduit-triaged)

Attachments

(1 file)

I just installed moz-phab using the default instructions on windows. I have a mozilla-unified checkout, and I ran:

$ moz-phab patch D37922 --apply-to here

Which is a patch by me which was failing some tests on windows.

ER:

  • Patch is applied.

AR:

Checking repository..
Fetching D37922..
Fetching D37922 children..
Fetching D37922 parents..
Patching revision: D37922
Downloading patch information..
Bookmark set to D37922
Downloading D37922..
Applying D37922..
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc1' in position 164: ordinal not in range(128)

That ordinal is familiar (it's the Á in my last name).

Ran with DEBUG=1:

DEBUG    2019-07-18 20:26:06,637 found hg repo in c:\moz\mozilla-unified
DEBUG    2019-07-18 20:26:06,637 $ hg.exe --version --quiet
DEBUG    2019-07-18 20:26:06,815 Mercurial Distributed SCM (version 5.0.2)
DEBUG    2019-07-18 20:26:06,815 $ hg.exe config
DEBUG    2019-07-18 20:26:07,039 $ hg.exe --config extensions.rebase= status --added --deleted --modified --unknown
DEBUG    2019-07-18 20:26:07,486 Calling Conduit API https://phabricator.services.mozilla.com/api/differential.revision.search
DEBUG    2019-07-18 20:26:08,503 Calling Conduit API https://phabricator.services.mozilla.com/api/edge.search
DEBUG    2019-07-18 20:26:09,302 Calling Conduit API https://phabricator.services.mozilla.com/api/edge.search
INFO     2019-07-18 20:26:10,124 Patching revision: D37922
DEBUG    2019-07-18 20:26:10,124 Calling Conduit API https://phabricator.services.mozilla.com/api/differential.diff.search
DEBUG    2019-07-18 20:26:10,970 $ hg.exe --config extensions.rebase= bookmarks -T '{bookmark}\n'
DEBUG    2019-07-18 20:26:11,201 D37922
D37922_1
DEBUG    2019-07-18 20:26:11,217 $ hg.exe --config extensions.rebase= bookmark D37922_2
INFO     2019-07-18 20:26:11,523 Bookmark set to D37922_2
DEBUG    2019-07-18 20:26:11,538 Calling Conduit API https://phabricator.services.mozilla.com/api/differential.getrawdiff
DEBUG    2019-07-18 20:26:12,357 $ hg.exe --config extensions.rebase= import 'c:\users\emilio~1\appdata\local\temp\tmpyn9hhn' --quiet -l 'c:\users\emilio~1\appdata\local\temp\tmpr2zjt9' -u 'Emilio Cobos Álvarez <emilio@crisal.io>' -d 2019-07-17T01:11:42
ERROR    2019-07-18 20:26:12,378 Traceback (most recent call last):
  File "c:/Users/Emilio Alvarez/phabricator/moz-phab", line 3769, in main
    args.func(repo, args)
  File "c:/Users/Emilio Alvarez/phabricator/moz-phab", line 3434, in patch
    repo.apply_patch(raw, body, author, author_date)
  File "c:/Users/Emilio Alvarez/phabricator/moz-phab", line 1515, in apply_patch
    self.hg(["import", patch_file, "--quiet", "-l", body_file] + commands)
  File "c:/Users/Emilio Alvarez/phabricator/moz-phab", line 1244, in hg
    check_call(self._hg + command, cwd=self.path, **kwargs)
  File "c:/Users/Emilio Alvarez/phabricator/moz-phab", line 265, in check_call
    subprocess.check_call(command, **kwargs)
  File "c:\mozilla-build\python\lib\subprocess.py", line 185, in check_call
    retcode = call(*popenargs, **kwargs)
  File "c:\mozilla-build\python\lib\subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "c:\mozilla-build\python\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "c:\mozilla-build\python\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc1' in position 164: ordinal not in range(128)

Missing encode() call looks like.

Assignee: nobody → emilio

Otherwise names with non-ascii characters error out.

I usually use Git on Linux instead of Mercurial on Windows, so I
assume the Git code-path works, though it may also be a Python3
thing. Let me know if you want me to call encode() on the Git
path as well.

Keywords: conduit-triaged
Priority: -- → P2
Attachment #9079116 - Attachment description: Bug 1567252 - Encode patch author as utf8. r=glob → Bug 1567252 - Encode patch author as utf8. r=zalun
Depends on: 1568495
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Blocks: 1607517
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: