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

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 9:44 p.m.
Message ID <f882aea109115b6edc3f0f0756b15bf4@localhost.localdomain>
Download mbox | patch
Permalink /patch/29010/
State Not Applicable
Headers show

Comments

phabricator - March 4, 2018, 9:44 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd3c231f8d27d: archival: ensure file mode for gzipfile is sysstr (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2672?vs=6615&id=6624

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

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit
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