# HG changeset patch # User Mads Kiilerich # Date 2015-03-06 16:21:24 # Node ID a5475229ba28f28882cd118e637641f5ceb64794 # Parent afddaa53ab8a2f02c4bcfd2f02111fcdc9db2ce9 vcs: better handling of closed subprocessio InputStreamChunker source stream test_git_cmd_injection would fail occasionaly. diff --git a/kallithea/lib/vcs/subprocessio.py b/kallithea/lib/vcs/subprocessio.py --- a/kallithea/lib/vcs/subprocessio.py +++ b/kallithea/lib/vcs/subprocessio.py @@ -133,7 +133,11 @@ class InputStreamChunker(Thread): "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.