Closed Bug 1299618 Opened 8 years ago Closed 8 years ago

UnicodeEncodeError on Windows when running |mach lint|

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

3 Branch
defect
Not set
normal

Tracking

(firefox51 fixed)

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: ahal, Assigned: ahal)

References

Details

Attachments

(1 file)

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
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: