Patchwork D2656: archival: our filenames are bytes, not strs

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 7:16 p.m.
Message ID <18b491d4d12b39729d55ac313d3ce123@localhost.localdomain>
Download mbox | patch
Permalink /patch/28961/
State Not Applicable
Headers show

Comments

phabricator - March 4, 2018, 7:16 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7f9a6f5f7612: archival: our filenames are bytes, not strs (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2656?vs=6575&id=6584

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

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -168,7 +168,7 @@ 
                 return tarfile.open(
                     name, pycompat.sysstr(mode + kind), fileobj)
 
-        if isinstance(dest, str):
+        if isinstance(dest, bytes):
             self.z = taropen('w:', name=dest)
         else:
             self.z = taropen('w|', fileobj=dest)
@@ -217,7 +217,7 @@ 
     or compressed with deflate.'''
 
     def __init__(self, dest, mtime, compress=True):
-        if not isinstance(dest, str):
+        if not isinstance(dest, bytes):
             try:
                 dest.tell()
             except (AttributeError, IOError):