From 3911ff348f73dc60ad0b4fb5a4619e67198e0393 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 12 Sep 2014 15:48:20 +0300 Subject: [PATCH] GitRepository/__git_inout: correctly handle input error Change-Id: I3c9b8851490c05719f77a9519418a98f572d68e3 Signed-off-by: Markus Lehtonen --- gbp/git/repository.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gbp/git/repository.py b/gbp/git/repository.py index f52f3f2..fa3ed52 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -252,7 +252,12 @@ class GitRepository(object): ready = select.select(out_fds, in_fds, []) # Write in chunks of 512 bytes if ready[1]: - popen.stdin.write(stdin[w_ind:w_ind+512]) + try: + popen.stdin.write(stdin[w_ind:w_ind+512]) + except IOError: + # Ignore, we want to read buffers to e.g. get error message + # Git should give an error code so that we catch an error + pass w_ind += 512 if w_ind > len(stdin): rm_polled_fd(popen.stdin, in_fds) -- 2.7.4