diff mercurial/changegroup.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 5859800edfc5
children 83534c4ec58b
line wrap: on
line diff
--- a/mercurial/changegroup.py	Thu May 03 18:39:58 2018 +0900
+++ b/mercurial/changegroup.py	Sat May 26 12:14:04 2018 +0900
@@ -9,7 +9,6 @@
 
 import os
 import struct
-import tempfile
 import weakref
 
 from .i18n import _
@@ -80,7 +79,7 @@
                 # small (4k is common on Linux).
                 fh = open(filename, "wb", 131072)
         else:
-            fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg")
+            fd, filename = pycompat.mkstemp(prefix="hg-bundle-", suffix=".hg")
             fh = os.fdopen(fd, r"wb")
         cleanup = filename
         for c in chunks: