diff options
author | Ivan Ryabchenko <rik.ggm@gmail.com> | 2015-10-15 12:23:21 +0600 |
---|---|---|
committer | Рябченко Иван Константинович <i.ryabchenko@2gis.ru> | 2015-10-15 12:31:25 +0600 |
commit | 2cc8f1e3c6627f0b4da7cb6550f7252f76529d8e (patch) | |
tree | 25db781ea4a89b55526bb4abc91face04fdd01dc /git/cmd.py | |
parent | 51f79ffeb829315c33ce273ae69baf0fdd1fbd1e (diff) | |
download | gitpython-2cc8f1e3c6627f0b4da7cb6550f7252f76529d8e.tar.gz |
fix(cmd): fixed deadlock when stderr buffer overflow
Fixed deadlock when using stderr=PIPE in Popen and Git generates enough
output to a pipe such that it blocks waiting for the OS pipe buffer to
accept more data (see
https://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait)
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -310,11 +310,11 @@ class Git(LazyMixin): """Wait for the process and return its status code. :raise GitCommandError: if the return status is not 0""" - status = self.proc.wait() - if status != 0: - raise GitCommandError(self.args, status, self.proc.stderr.read()) + stderr_value = self.proc.communicate()[1] + if self.proc.returncode != 0: + raise GitCommandError(self.args, status, stderr_value) # END status handling - return status + return self.proc.returncode # END auto interrupt class CatFileContentStream(object): |