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

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 6:12 p.m.
Message ID <differential-rev-PHID-DREV-ufavbruwoiknuobc7mdx-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28951/
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/D2656

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
@@ -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):