Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Can get a str object from stream.read rather then bytes.
Convert to the expected bytes.
  • Loading branch information
barry-scott committed Jun 6, 2016
commit 6891caf73735ea465c909de8dc13129cc98c47f7
5 changes: 4 additions & 1 deletion git/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ def wait(self, stderr=b''):

def read_all_from_possibly_closed_stream(stream):
try:
return stderr + stream.read()
last_stderr = stream.read()
if type(last_stderr) == unicode:
last_stderr = last_stderr.encode(defenc)
return stderr + last_stderr
except ValueError:
return stderr or b''

Expand Down