archival: ensure file mode for gzipfile is sysstr
authorAugie Fackler <augie@google.com>
Sun, 04 Mar 2018 16:06:27 -0500
changeset 36750 d3c231f8d27d
parent 36749 009da8c28e4d
child 36751 f14ba6eb2b5a
archival: ensure file mode for gzipfile is sysstr Differential Revision: https://phab.mercurial-scm.org/D2672
mercurial/archival.py
--- a/mercurial/archival.py	Sun Mar 04 16:06:10 2018 -0500
+++ b/mercurial/archival.py	Sun Mar 04 16:06:27 2018 -0500
@@ -158,7 +158,8 @@
                 mode = mode[0:1]
                 if not fileobj:
                     fileobj = open(name, mode + 'b')
-                gzfileobj = self.GzipFileWithTime(name, mode + 'b',
+                gzfileobj = self.GzipFileWithTime(name,
+                                                  pycompat.sysstr(mode + 'b'),
                                                   zlib.Z_BEST_COMPRESSION,
                                                   fileobj, timestamp=mtime)
                 self.fileobj = gzfileobj