diff mercurial/bundlerepo.py @ 30944:48dea083f66d

py3: convert the mode argument of os.fdopen to unicodes (1 of 2) os.fdopen() does not accepts bytes as its second argument which represent the mode in which the file is to be opened. This patch makes sure unicodes are passed in py3 by using pycompat.sysstr().
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 13 Feb 2017 20:06:38 +0530
parents c1b7b2285522
children 5f68e7341ada
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Thu Feb 09 15:20:41 2017 -0500
+++ b/mercurial/bundlerepo.py	Mon Feb 13 20:06:38 2017 +0530
@@ -272,7 +272,7 @@
                                             suffix=".hg10un")
             self.tempfile = temp
 
-            with os.fdopen(fdtemp, 'wb') as fptemp:
+            with os.fdopen(fdtemp, pycompat.sysstr('wb')) as fptemp:
                 fptemp.write(header)
                 while True:
                     chunk = read(2**18)