changeset 36727:d3c231f8d27d

archival: ensure file mode for gzipfile is sysstr Differential Revision: https://phab.mercurial-scm.org/D2672
author Augie Fackler <augie@google.com>
date Sun, 04 Mar 2018 16:06:27 -0500
parents 009da8c28e4d
children f14ba6eb2b5a
files mercurial/archival.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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