diff mercurial/cmdutil.py @ 38164: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 c974320d20b9
children 51e420a7a41a
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Thu May 03 18:39:58 2018 +0900
+++ b/mercurial/cmdutil.py	Sat May 26 12:14:04 2018 +0900
@@ -10,7 +10,6 @@
 import errno
 import os
 import re
-import tempfile
 
 from .i18n import _
 from .node import (
@@ -329,7 +328,7 @@
         try:
             # backup continues
             for f in tobackup:
-                fd, tmpname = tempfile.mkstemp(prefix=f.replace('/', '_')+'.',
+                fd, tmpname = pycompat.mkstemp(prefix=f.replace('/', '_') + '.',
                                                dir=backupdir)
                 os.close(fd)
                 ui.debug('backup %r as %r\n' % (f, tmpname))