diff mercurial/patch.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 f3776f70985e
children 2ce60954b1b7
line wrap: on
line diff
--- a/mercurial/patch.py	Thu May 03 18:39:58 2018 +0900
+++ b/mercurial/patch.py	Sat May 26 12:14:04 2018 +0900
@@ -211,7 +211,7 @@
     Any item can be missing from the dictionary. If filename is missing,
     fileobj did not contain a patch. Caller must unlink filename when done.'''
 
-    fd, tmpname = tempfile.mkstemp(prefix='hg-patch-')
+    fd, tmpname = pycompat.mkstemp(prefix='hg-patch-')
     tmpfp = os.fdopen(fd, r'wb')
     try:
         yield _extract(ui, fileobj, tmpname, tmpfp)
@@ -1109,7 +1109,7 @@
 all lines of the hunk are removed, then the edit is aborted and
 the hunk is left unchanged.
 """)
-                (patchfd, patchfn) = tempfile.mkstemp(prefix="hg-editor-",
+                (patchfd, patchfn) = pycompat.mkstemp(prefix="hg-editor-",
                                                       suffix=".diff")
                 ncpatchfp = None
                 try: