diff options
author | Barry Scott <barry@barrys-emacs.org> | 2016-07-12 18:27:03 +0100 |
---|---|---|
committer | Barry Scott <barry@barrys-emacs.org> | 2016-07-12 18:27:03 +0100 |
commit | b4b5ecc217154405ac0f6221af99a4ab18d067f6 (patch) | |
tree | 42ec5a4a19a52158c6aa6a20afabd75450f4fbe2 /git/cmd.py | |
parent | a7f403b1e82d4ada20d0e747032c7382e2a6bf63 (diff) | |
parent | 4896fa2ccbd84553392e2a74af450d807e197783 (diff) | |
download | gitpython-b4b5ecc217154405ac0f6221af99a4ab18d067f6.tar.gz |
Merge branch 'master' of https://github.com/gitpython-developers/GitPython
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -14,7 +14,6 @@ import errno import mmap from git.odict import OrderedDict - from contextlib import contextmanager import signal from subprocess import ( @@ -40,7 +39,8 @@ from git.compat import ( PY3, bchr, # just to satisfy flake8 on py3 - unicode + unicode, + safe_decode, ) execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', @@ -694,12 +694,12 @@ class Git(LazyMixin): cmdstr = " ".join(command) def as_text(stdout_value): - return not output_stream and stdout_value.decode(defenc) or '<OUTPUT_STREAM>' + return not output_stream and safe_decode(stdout_value) or '<OUTPUT_STREAM>' # 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: @@ -713,11 +713,11 @@ class Git(LazyMixin): 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 |