D5073: archival: don't try and fsdecode non-{bytes,str} objects

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sat Oct 13 08:21:18 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG844deb408a5b: archival: don't try and fsdecode non-{bytes,str} objects (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5073?vs=12050&id=12056

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

AFFECTED FILES
  mercurial/archival.py

CHANGE DETAILS

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -203,7 +203,9 @@
     or compressed with deflate.'''
 
     def __init__(self, dest, mtime, compress=True):
-        self.z = zipfile.ZipFile(pycompat.fsdecode(dest), r'w',
+        if isinstance(dest, bytes):
+            dest = pycompat.fsdecode(dest)
+        self.z = zipfile.ZipFile(dest, r'w',
                                  compress and zipfile.ZIP_DEFLATED or
                                  zipfile.ZIP_STORED)
 



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


More information about the Mercurial-devel mailing list