Closed Bug 1609281 Opened 6 years ago Closed 6 years ago

Loading a mozconfig does not work if there is a unicode environment variable

Categories

(Firefox Build System :: Mach Core, defect)

defect
Not set
normal

Tracking

(firefox74 fixed)

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: tomprince, Assigned: rstewart)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

If I try to run any command that tries to load a mozconfig (such as mach python -- --version), when I have a unicode environment variable, I get the following error:

$ TEST_ENV_VAR=$(python3 -c 'print("U{snowman}")') mach python -- --version                                                                                                             
Error loading mozconfig: /Depot/Mozilla/mozilla-central/.mozconfig

Evaluation of your mozconfig exited with an error. This could be triggered
by a command inside your mozconfig failing. Please change your mozconfig
to not error and/or to catch errors in executed commands.

mozconfig output:

------BEGIN_ENV_BEFORE_SOURCE
LESS='-R -M --shift 5'
<....>
Traceback (most recent call last):
  File "/Depot/Mozilla/mozilla-central/python/mozbuild/mozbuild/action/dump_env.py", line 19, in <module>
    print('%s=%s' % (key, quote(value)))
  File "/Depot/Mozilla/mozilla-central/python/mozbuild/mozbuild/action/../shellutil.py", line 210, in quote
    return ' '.join(_quote(s) for s in strings)
  File "/Depot/Mozilla/mozilla-central/python/mozbuild/mozbuild/action/../shellutil.py", line 210, in <genexpr>
    return ' '.join(_quote(s) for s in strings)
  File "/Depot/Mozilla/mozilla-central/python/mozbuild/mozbuild/action/../shellutil.py", line 191, in _quote
    if s and not SHELL_QUOTE_RE.search(s) and not s.startswith('~'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
Flags: needinfo?(rstewart)
Assignee: nobody → rstewart
Flags: needinfo?(rstewart)
Attachment #9121069 - Attachment description: Bug 1609281 - Loading a mozconfig does not work if there is a unicode environment variable → Bug 1609281 - Use the correct encoding when dumping the environment variables in mozconfig
Summary: Loading a mozconfig does not work if there is a environment variable → Loading a mozconfig does not work if there is a unicode environment variable
Pushed by rstewart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/933d436bc502 Use the correct encoding when dumping the environment variables in mozconfig r=firefox-build-system-reviewers,froydnj
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Has Regression Range: --- → yes
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: