mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 17:59:34 +00:00

`mozversioncontrol` runs currently use `universal_newlines`, which is an alias for `text`. This forces the command output file object to be opened in text mode using the platform's default encoding. On Windows the default encoding is usually a single-byte encoding such as `cp-1252`, which can cause issues when parsing patches that include multi-byte sequences. Add an `encoding` option to `_run` with `utf-8` as the default option and change the `check_output` call to use it. Callers can revert to the previous behaviour quite easily by setting `encoding=None` if necessary. Differential Revision: https://phabricator.services.mozilla.com/D190710