From 0836a22d38f4fa29d3cbc543fcd7a42813ec052d Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Wed, 25 Sep 2013 17:46:01 -0700 Subject: [PATCH] Wait for git-remote-persistent-https -print_config to exit Change-Id: I5ab96e7c8575682217d440ddc52ecfdc8c35f179 --- project.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/project.py b/project.py index bc997e78..cbc3c219 100644 --- a/project.py +++ b/project.py @@ -1831,17 +1831,22 @@ class Project(object): ['git-remote-persistent-https', '-print_config', url], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p.stdin.close() # Tell subprocess it's ok to close. prefix = 'http.cookiefile=' + cookiefile = None for line in p.stdout: line = line.strip() if line.startswith(prefix): - return line[len(prefix):] + cookiefile = line[len(prefix):] + break if p.wait(): line = iter(p.stderr).next() if ' -print_config' in line: pass # Persistent proxy doesn't support -print_config. else: print(line + p.stderr.read(), file=sys.stderr) + if cookiefile: + return cookiefile except OSError as e: if e.errno == errno.ENOENT: pass # No persistent proxy.