diff --git a/mach b/mach index 9aba2825387e..dbbd8fca40e2 100755 --- a/mach +++ b/mach @@ -33,8 +33,7 @@ for dir_path in ancestors(os.getcwd()): # to look for a config file at the path in $MOZCONFIG rather than # its default locations. # - # Note: subprocess requires native strings in os.environ Python - # 2.7.2 and earlier on Windows. + # Note: subprocess requires native strings in os.environ on Windows os.environ[b"MOZCONFIG"] = str(info["mozconfig"]) if "topsrcdir" in info: diff --git a/python/mach_commands.py b/python/mach_commands.py index 50286ba232f9..3d920b0e6c1a 100644 --- a/python/mach_commands.py +++ b/python/mach_commands.py @@ -59,7 +59,8 @@ def python(self, args): return self.run_process([self.python_executable] + args, pass_thru=True, # Allow user to run Python interactively. ensure_exit_code=False, # Don't throw on non-zero exit code. - append_env={'PYTHONDONTWRITEBYTECODE': '1'}) + # Note: subprocess requires native strings in os.environ on Windows + append_env={b'PYTHONDONTWRITEBYTECODE': str('1')}) @Command('python-test', category='testing', description='Run Python unit tests.') @@ -109,7 +110,8 @@ def _line_handler(line): [self.python_executable, file], ensure_exit_code=False, # Don't throw on non-zero exit code. log_name='python-test', - append_env={'PYTHONDONTWRITEBYTECODE': '1'}, + # subprocess requires native strings in os.environ on Windows + append_env={b'PYTHONDONTWRITEBYTECODE': str('1')}, line_handler=_line_handler) return_code += inner_return_code diff --git a/testing/mochitest/mach_commands.py b/testing/mochitest/mach_commands.py index 5e14e278ad17..7ec1afc08b8c 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -149,7 +149,6 @@ def run_mochitest_test(self, suite=None, test_file=None, debugger=None, return 1 options.testPath = test_path - env = {'TEST_PATH': test_path} if rerun_failures: options.testManifest = failure_file_path