[Updated] D11472: archival: force a `CompressionError` to bytes before passing to `error.Abort`

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Wed Sep 22 07:56:53 UTC 2021


Closed by commit rHG406a7e629946: archival: force a `CompressionError` to bytes before passing to `error.Abort` (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11472?vs=30346&id=30364

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11472/new/

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

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
@@ -29,6 +29,8 @@
     vfs as vfsmod,
 )
 
+from .utils import stringutil
+
 stringio = util.stringio
 
 # from unzip source code:
@@ -196,7 +198,7 @@
                         name, pycompat.sysstr(mode + kind), fileobj
                     )
                 except tarfile.CompressionError as e:
-                    raise error.Abort(pycompat.bytestr(e))
+                    raise error.Abort(stringutil.forcebytestr(e))
 
         if isinstance(dest, bytes):
             self.z = taropen(b'w:', name=dest)



To: mharbison72, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210922/b886d9df/attachment-0002.html>


More information about the Mercurial-patches mailing list