The current stdin patch importing expects two EOFs since the 'for' loop
doesn't start before one EOF is received. As suggested, this patch changes
the 'for' loop with a 'while True' loop.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
descr = authname = authemail = authdate = None
# parse the headers
descr = authname = authemail = authdate = None
# parse the headers
+ while True:
+ line = f.readline()
+ if not line:
+ break
line = line.strip()
if re.match('from:\s+', line, re.I):
auth = re.findall('^.*?:\s+(.*)$', line)[0]
line = line.strip()
if re.match('from:\s+', line, re.I):
auth = re.findall('^.*?:\s+(.*)$', line)[0]
raise CmdException, 'Subject: line not found'
# the rest of the patch description
raise CmdException, 'Subject: line not found'
# the rest of the patch description
+ while True:
+ line = f.readline()
+ if not line:
+ break
if re.match('---\s*$', line) or re.match('diff -', line) or \
re.match('^Index: ', line):
break
if re.match('---\s*$', line) or re.match('diff -', line) or \
re.match('^Index: ', line):
break
authname = authemail = authdate = None
descr = ''
authname = authemail = authdate = None
descr = ''
+ while True:
+ line = f.readline()
+ if not line:
+ break
+
# the first 'Signed-of-by:' is the author
if not authname and re.match('signed-off-by:\s+', line, re.I):
auth = re.findall('^.*?:\s+(.*)$', line)[0]
# the first 'Signed-of-by:' is the author
if not authname and re.match('signed-off-by:\s+', line, re.I):
auth = re.findall('^.*?:\s+(.*)$', line)[0]
def _input(cmd, file_desc):
p = popen2.Popen3(cmd)
def _input(cmd, file_desc):
p = popen2.Popen3(cmd)
+ while True:
+ line = file_desc.readline()
+ if not line:
+ break
p.tochild.write(line)
p.tochild.close()
if p.wait():
p.tochild.write(line)
p.tochild.close()
if p.wait():