diff mercurial/utils/procutil.py @ 38197:aac4be30e250

py3: wrap tempfile.mkstemp() to use bytes path This patch just flips the default to use a bytes path on Python 3. ca1cf9b3cce7 is backed out as the bundlepath should be bytes now.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 26 May 2018 12:14:04 +0900
parents 632b92899203
children d24ad71ff869
line wrap: on
line diff
--- a/mercurial/utils/procutil.py	Thu May 03 18:39:58 2018 +0900
+++ b/mercurial/utils/procutil.py	Sat May 26 12:14:04 2018 +0900
@@ -16,7 +16,6 @@
 import signal
 import subprocess
 import sys
-import tempfile
 import time
 
 from ..i18n import _
@@ -164,11 +163,11 @@
     the temporary files generated.'''
     inname, outname = None, None
     try:
-        infd, inname = tempfile.mkstemp(prefix='hg-filter-in-')
+        infd, inname = pycompat.mkstemp(prefix='hg-filter-in-')
         fp = os.fdopen(infd, r'wb')
         fp.write(s)
         fp.close()
-        outfd, outname = tempfile.mkstemp(prefix='hg-filter-out-')
+        outfd, outname = pycompat.mkstemp(prefix='hg-filter-out-')
         os.close(outfd)
         cmd = cmd.replace('INFILE', inname)
         cmd = cmd.replace('OUTFILE', outname)