diff --git a/python/mozversioncontrol/mozversioncontrol/__init__.py b/python/mozversioncontrol/mozversioncontrol/__init__.py index 5f01528db8b6..7ae541f321cd 100644 --- a/python/mozversioncontrol/mozversioncontrol/__init__.py +++ b/python/mozversioncontrol/mozversioncontrol/__init__.py @@ -95,7 +95,7 @@ class Repository(object): def __exit__(self, exc_type, exc_value, exc_tb): pass - def _run(self, *args, **runargs): + def _run(self, *args, encoding="utf-8", **runargs): return_codes = runargs.get("return_codes", []) cmd = (str(self._tool),) + args @@ -108,7 +108,10 @@ class Repository(object): else: try: return subprocess.check_output( - cmd, cwd=self.path, env=self._env, universal_newlines=True + cmd, + cwd=self.path, + env=self._env, + encoding=encoding, ) except subprocess.CalledProcessError as e: if e.returncode in return_codes: