Patchwork D2672: archival: ensure file mode for gzipfile is sysstr

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 9:13 p.m.
Message ID <differential-rev-PHID-DREV-hz6v3wreoijrk2szht4q-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28995/
State Superseded
Headers show

Comments

phabricator - March 4, 2018, 9:13 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2672

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -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