Patchwork D2655: archival: tar file modes need to be sysstrs

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

Comments

phabricator - March 4, 2018, 6:12 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/D2655

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
@@ -162,9 +162,11 @@ 
                                                   zlib.Z_BEST_COMPRESSION,
                                                   fileobj, timestamp=mtime)
                 self.fileobj = gzfileobj
-                return tarfile.TarFile.taropen(name, mode, gzfileobj)
+                return tarfile.TarFile.taropen(
+                    name, pycompat.sysstr(mode), gzfileobj)
             else:
-                return tarfile.open(name, mode + kind, fileobj)
+                return tarfile.open(
+                    name, pycompat.sysstr(mode + kind), fileobj)
 
         if isinstance(dest, str):
             self.z = taropen('w:', name=dest)