diff --git a/git/cmd.py b/git/cmd.py index 82434673f..d84695651 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -39,7 +39,8 @@ PY3, bchr, # just to satisfy flake8 on py3 - unicode + unicode, + safe_decode, ) execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', @@ -693,12 +694,12 @@ def _kill_process(pid): cmdstr = " ".join(command) def as_text(stdout_value): - return not output_stream and stdout_value.decode(defenc) or '' + return not output_stream and safe_decode(stdout_value) or '' # end if stderr_value: log.info("%s -> %d; stdout: '%s'; stderr: '%s'", - cmdstr, status, as_text(stdout_value), stderr_value.decode(defenc)) + cmdstr, status, as_text(stdout_value), safe_decode(stderr_value)) elif stdout_value: log.info("%s -> %d; stdout: '%s'", cmdstr, status, as_text(stdout_value)) else: @@ -712,11 +713,11 @@ def as_text(stdout_value): raise GitCommandError(command, status, stderr_value) if isinstance(stdout_value, bytes) and stdout_as_string: # could also be output_stream - stdout_value = stdout_value.decode(defenc) + stdout_value = safe_decode(stdout_value) # Allow access to the command's status code if with_extended_output: - return (status, stdout_value, stderr_value.decode(defenc)) + return (status, stdout_value, safe_decode(stderr_value)) else: return stdout_value pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy