diff options
author | Daniel Kutik <daniel.kutik@lavawerk.com> | 2022-12-13 13:01:02 +0100 |
---|---|---|
committer | Daniel Kutik <daniel.kutik@lavawerk.com> | 2022-12-13 16:23:46 +0000 |
commit | 7438aef1cad5a73a421d8bdde0dfc994d9ae92ed (patch) | |
tree | a29d52c2d41b5431853b24950f5f682aadeac48e | |
parent | e641281d144cca09a451497209e748056cdd79bb (diff) | |
download | git-repo-7438aef1cad5a73a421d8bdde0dfc994d9ae92ed.tar.gz |
Use 'backslashreplace' for decode
Resolve TODO as we are now requiring Python 3.
Change-Id: I7821627bd5c606276741c98efedaf5b11aecbcc3
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354702
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com>
-rwxr-xr-x | repo | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -447,8 +447,7 @@ def run_command(cmd, **kwargs): | |||
447 | except UnicodeError: | 447 | except UnicodeError: |
448 | print('repo: warning: Invalid UTF-8 output:\ncmd: %r\n%r' % (cmd, output), | 448 | print('repo: warning: Invalid UTF-8 output:\ncmd: %r\n%r' % (cmd, output), |
449 | file=sys.stderr) | 449 | file=sys.stderr) |
450 | # TODO(vapier): Once we require Python 3, use 'backslashreplace'. | 450 | return output.decode('utf-8', 'backslashreplace') |
451 | return output.decode('utf-8', 'replace') | ||
452 | 451 | ||
453 | # Run & package the results. | 452 | # Run & package the results. |
454 | proc = subprocess.Popen(cmd, **kwargs) | 453 | proc = subprocess.Popen(cmd, **kwargs) |