UnicodeEncodeError on Windows when running |mach lint|

RESOLVED FIXED in Firefox 51

Status

defect
RESOLVED FIXED
3 years ago
7 months ago

People

(Reporter: ahal, Assigned: ahal)

Tracking

3 Branch
mozilla51
Dependency tree / graph

Firefox Tracking Flags

(firefox51 fixed)

Details

Attachments

(1 attachment)

Regression from bug 1258341. Technically this has been broken for awhile, but apparently no one has tried running |mach lint| on Windows until now.

It seems like the msys shell just isn't capable of handling unicode. I have a patch that at least causes the command to *not fail*. Though the 'x' at the end of the output shows up garbled. I don't think it's worth much time trying to fix it further though.

A workaround to this until it lands is:
export PYTHONIOENCODING=UTF-8
Note: even after this patch instead of the unicode 'x', users will see some garbage text. But at least they'll be able to run |mach lint|. So we should land this patch for now and deal with actually getting the 'x' to display properly later. Or more likely, just not print unicode in the first place when on msys.
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Comment on attachment 8787036 [details]
Bug 1299618 - [mozlint] Encode results to utf-8 before printing to stdout,

https://reviewboard.mozilla.org/r/75882/#review74012

::: python/mozlint/mozlint/cli.py:104
(Diff revision 1)
>  
>      # run all linters
>      results = lint.roll(paths, rev=rev, workdir=workdir)
>  
>      formatter = formatters.get(fmt)
> -    print(formatter(results))
> +    print(formatter(results).encode('utf-8', 'replace'))

Can you add a comment note about the problems with this partial solution?
Attachment #8787036 - Flags: review?(smacleod) → review+
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eeba75f09439
[mozlint] Encode results to utf-8 before printing to stdout, r=smacleod
https://hg.mozilla.org/mozilla-central/rev/eeba75f09439
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.