From cbc0798f67b56b96f2bb6eac701b019d9bfd5e19 Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Thu, 21 Nov 2013 10:38:03 -0800 Subject: [PATCH] Fix print of git-remote-persistent-https error If git-remote-persistent-https fails, we use an iter() and then subsequently a .read() on stderr. Python doesn't like this and gives the following error message: ValueError: Mixing iteration and read methods would lose data This change removes the use of iter() to avoid the issue. Change-Id: I980659b83229e2a559c20dcc7b116f8d2476abd5 --- project.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project.py b/project.py index 66316411..b01a52ba 100644 --- a/project.py +++ b/project.py @@ -1840,11 +1840,11 @@ class Project(object): cookiefile = line[len(prefix):] break if p.wait(): - line = iter(p.stderr).next() - if ' -print_config' in line: + err_msg = p.stderr.read() + if ' -print_config' in err_msg: pass # Persistent proxy doesn't support -print_config. else: - print(line + p.stderr.read(), file=sys.stderr) + print(err_msg, file=sys.stderr) if cookiefile: return cookiefile except OSError as e: