summaryrefslogtreecommitdiff
path: root/git/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/util.py')
-rw-r--r--git/util.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/git/util.py b/git/util.py
index 010130cb..06fefcc3 100644
--- a/git/util.py
+++ b/git/util.py
@@ -17,7 +17,11 @@ import threading
# NOTE: Some of the unused imports might be used/imported by others.
# Handle once test-cases are back up and running.
from .exc import GitCommandError
-from .compat import MAXSIZE
+from .compat import (
+ MAXSIZE,
+ defenc,
+ PY3
+)
# Most of these are unused here, but are for use by git-python modules so these
# don't see gitdb all the time. Flake of course doesn't like it.
@@ -247,7 +251,10 @@ class RemoteProgress(object):
message = message[:-len(done_token)]
# END end message handling
- self.update(op_code, cur_count, max_count, message)
+ self.update(op_code,
+ cur_count and float(cur_count),
+ max_count and float(max_count),
+ message)
# END for each sub line
return failed_lines
@@ -364,7 +371,11 @@ class Actor(object):
for attr, evar, cvar, default in (('name', env_name, cls.conf_name, default_name),
('email', env_email, cls.conf_email, default_email)):
try:
- setattr(actor, attr, os.environ[evar])
+ val = os.environ[evar]
+ if not PY3:
+ val = val.decode(defenc)
+ # end assure we don't get 'invalid strings'
+ setattr(actor, attr, val)
except KeyError:
if config_reader is not None:
setattr(actor, attr, config_reader.get_value('user', cvar, default))