summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-09-28 14:43:47 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-09-28 17:13:22 +0200
commitf11fdf1d9d22a198511b02f3ca90146cfa5deb5c (patch)
treeb8b902a555a6626294bd9388ff1bef11abef39e3
parentcf2335af23fb693549d6c4e72b65f97afddc5f64 (diff)
downloadgitpython-f11fdf1d9d22a198511b02f3ca90146cfa5deb5c.tar.gz
remote, #519: FIX1-of-2 double-decoding push-infos
+ When `universal_lines==True` (515a6b9ccf8) must tel `handle_process_output` to stop decoding strings.
-rw-r--r--git/remote.py3
-rw-r--r--git/test/lib/helper.py8
-rw-r--r--git/util.py1
3 files changed, 9 insertions, 3 deletions
diff --git a/git/remote.py b/git/remote.py
index 7a7b4840..07f5b432 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -681,7 +681,8 @@ class Remote(LazyMixin, Iterable):
# END for each line
try:
- handle_process_output(proc, stdout_handler, progress_handler, finalize_process)
+ handle_process_output(proc, stdout_handler, progress_handler, finalize_process,
+ decode_stdout=False, decode_stderr=False)
except Exception:
if len(output) == 0:
raise
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py
index 6d840027..949e474f 100644
--- a/git/test/lib/helper.py
+++ b/git/test/lib/helper.py
@@ -258,8 +258,10 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
# We assume in good faith that we didn't start the daemon - but make sure we kill it anyway
# Of course we expect it to work here already, but maybe there are timing constraints
# on some platforms ?
- if gd is not None:
+ try:
gd.proc.terminate()
+ except Exception as ex:
+ log.debug("Ignoring %r while terminating proc after %r.", ex, e)
log.warning('git(%s) ls-remote failed due to:%s',
rw_repo.git_dir, e)
if is_win:
@@ -296,8 +298,10 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
os.chdir(prev_cwd)
finally:
- if gd is not None:
+ try:
gd.proc.kill()
+ except:
+ pass ## Either it has died (and we're here), or it won't die, again here...
rw_repo.git.clear_cache()
rw_remote_repo.git.clear_cache()
diff --git a/git/util.py b/git/util.py
index 9faa8eff..f6f6dea9 100644
--- a/git/util.py
+++ b/git/util.py
@@ -3,6 +3,7 @@
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
+from __future__ import unicode_literals
import os
import re