Skip to content

Pr cmd raise with stderr on error #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 13, 2016
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