diff hgext/convert/subversion.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 c560a4ea6dac
children 65d1d7da63d1
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Thu May 03 18:39:58 2018 +0900
+++ b/hgext/convert/subversion.py	Sat May 26 12:14:04 2018 +0900
@@ -5,7 +5,6 @@
 
 import os
 import re
-import tempfile
 import xml.dom.minidom
 
 from mercurial.i18n import _
@@ -1225,7 +1224,7 @@
         wdest = self.wjoin(dest)
         exists = os.path.lexists(wdest)
         if exists:
-            fd, tempname = tempfile.mkstemp(
+            fd, tempname = pycompat.mkstemp(
                 prefix='hg-copy-', dir=os.path.dirname(wdest))
             os.close(fd)
             os.unlink(tempname)
@@ -1313,7 +1312,7 @@
             self.xargs(self.setexec, 'propset', 'svn:executable', '*')
             self.setexec = []
 
-        fd, messagefile = tempfile.mkstemp(prefix='hg-convert-')
+        fd, messagefile = pycompat.mkstemp(prefix='hg-convert-')
         fp = os.fdopen(fd, r'wb')
         fp.write(util.tonativeeol(commit.desc))
         fp.close()