changeset 4882:a5475229ba28

vcs: better handling of closed subprocessio InputStreamChunker source stream test_git_cmd_injection would fail occasionaly.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 06 Mar 2015 16:21:24 +0100
parents afddaa53ab8a
children 8b08599d4b08
files kallithea/lib/vcs/subprocessio.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/vcs/subprocessio.py	Fri Mar 06 16:21:24 2015 +0100
+++ b/kallithea/lib/vcs/subprocessio.py	Fri Mar 06 16:21:24 2015 +0100
@@ -133,7 +133,11 @@
                         "Timed out while waiting for input from subprocess.")
             t.append(b)
             da.set()
-            b = s.read(cs)
+            try:
+                b = s.read(cs)
+            except ValueError: # probably "I/O operation on closed file"
+                b = ''
+
         self.EOF.set()
         da.set()  # for cases when done but there was no input.