Skip to content

Commit 6891caf

Browse files
committed
Can get a str object from stream.read rather then bytes.
Convert to the expected bytes.
1 parent 4a5ceba commit 6891caf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git/cmd.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,10 @@ def wait(self, stderr=b''):
338338

339339
def read_all_from_possibly_closed_stream(stream):
340340
try:
341-
return stderr + stream.read()
341+
last_stderr = stream.read()
342+
if type(last_stderr) == unicode:
343+
last_stderr = last_stderr.encode(defenc)
344+
return stderr + last_stderr
342345
except ValueError:
343346
return stderr or b''
344347

0 commit comments

Comments
 (0)
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