##// END OF EJS Templates
procutil: always popen() in binary mode...
Yuya Nishihara -
r37476:00e4bd97 default
parent child Browse files
Show More
@@ -528,8 +528,8 b' class bzmysql(bzaccess):'
528 528 except TypeError:
529 529 cmd = cmdfmt % {'bzdir': bzdir, 'id': id, 'user': user}
530 530 self.ui.note(_('running notify command %s\n') % cmd)
531 fp = procutil.popen('(%s) 2>&1' % cmd)
532 out = fp.read()
531 fp = procutil.popen('(%s) 2>&1' % cmd, 'rb')
532 out = util.fromnativeeol(fp.read())
533 533 ret = fp.close()
534 534 if ret:
535 535 self.ui.warn(out)
@@ -228,13 +228,13 b' def createlog(ui, directory=None, root="'
228 228 ui.note(_("running %s\n") % (' '.join(cmd)))
229 229 ui.debug("prefix=%r directory=%r root=%r\n" % (prefix, directory, root))
230 230
231 pfp = procutil.popen(' '.join(cmd))
232 peek = pfp.readline()
231 pfp = procutil.popen(' '.join(cmd), 'rb')
232 peek = util.fromnativeeol(pfp.readline())
233 233 while True:
234 234 line = peek
235 235 if line == '':
236 236 break
237 peek = pfp.readline()
237 peek = util.fromnativeeol(pfp.readline())
238 238 if line.endswith('\n'):
239 239 line = line[:-1]
240 240 #ui.debug('state=%d line=%r\n' % (state, line))
@@ -144,8 +144,8 b' def _sendmail(ui, sender, recipients, ms'
144 144 cmdline = '%s -f %s %s' % (program, stringutil.email(sender),
145 145 ' '.join(map(stringutil.email, recipients)))
146 146 ui.note(_('sending mail: %s\n') % cmdline)
147 fp = procutil.popen(cmdline, 'w')
148 fp.write(msg)
147 fp = procutil.popen(cmdline, 'wb')
148 fp.write(util.tonativeeol(msg))
149 149 ret = fp.close()
150 150 if ret:
151 151 raise error.Abort('%s %s' % (
@@ -2103,8 +2103,9 b' def _externalpatch(ui, repo, patcher, pa'
2103 2103 cwd = repo.root
2104 2104 if cwd:
2105 2105 args.append('-d %s' % procutil.shellquote(cwd))
2106 fp = procutil.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip,
2107 procutil.shellquote(patchname)))
2106 cmd = ('%s %s -p%d < %s'
2107 % (patcher, ' '.join(args), strip, procutil.shellquote(patchname)))
2108 fp = procutil.popen(cmd, 'rb')
2108 2109 try:
2109 2110 for line in util.iterfile(fp):
2110 2111 line = line.rstrip()
General Comments 0
You need to be logged in to leave comments. Login now