gecko-dev/python/mozversioncontrol
Connor Sheehan 02b9156f7c Bug 1857512: use utf-8 encoding for mozversioncontrol VCS commands r=zeid
`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
2023-10-11 21:26:41 +00:00
..