diff hgext/bugzilla.py @ 37458:00e4bd97b095

procutil: always popen() in binary mode On Python 3, non-binary stream is useless. Let's convert line ending by ourselves. Note that we don't need fromnativeeol() in patch._externalpatch() since any whitespace characters are rstrip()-ed.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 07 Apr 2018 20:50:38 +0900
parents a8a902d7176e
children bbd240f81ac5
line wrap: on
line diff
--- a/hgext/bugzilla.py	Sat Apr 07 13:46:32 2018 +0900
+++ b/hgext/bugzilla.py	Sat Apr 07 20:50:38 2018 +0900
@@ -528,8 +528,8 @@
             except TypeError:
                 cmd = cmdfmt % {'bzdir': bzdir, 'id': id, 'user': user}
             self.ui.note(_('running notify command %s\n') % cmd)
-            fp = procutil.popen('(%s) 2>&1' % cmd)
-            out = fp.read()
+            fp = procutil.popen('(%s) 2>&1' % cmd, 'rb')
+            out = util.fromnativeeol(fp.read())
             ret = fp.close()
             if ret:
                 self.ui.warn(out)