convert: use pycompat.fsencode()
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 04 Oct 2019 16:07:32 -0400
changeset 43072 058c2468b2f5
parent 43071 830eacef67f8
child 43073 5c9c71cde1c9
convert: use pycompat.fsencode() This avoids a `TypeError: Can't mix strings and bytes in path components`. Differential Revision: https://phab.mercurial-scm.org/D6965
hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py	Sat Oct 05 15:28:52 2019 -0400
+++ b/hgext/convert/gnuarch.py	Fri Oct 04 16:07:32 2019 -0400
@@ -85,7 +85,7 @@
 
         # Get name of temporary directory
         version = self.treeversion.split('/')
-        self.tmppath = os.path.join(tempfile.gettempdir(),
+        self.tmppath = os.path.join(pycompat.fsencode(tempfile.gettempdir()),
                                     'hg-%s' % version[1])
 
         # Generate parents dictionary