mercurial/archival.py
changeset 45083 3a6ec080b521
parent 45072 a56ba57c837d
parent 45048 2c0043977b6d
child 45942 89a2afe31e82
equal deleted inserted replaced
45082:b6afe1c52964 45083:3a6ec080b521
   187                 self.fileobj = gzfileobj
   187                 self.fileobj = gzfileobj
   188                 return tarfile.TarFile.taropen(  # pytype: disable=attribute-error
   188                 return tarfile.TarFile.taropen(  # pytype: disable=attribute-error
   189                     name, pycompat.sysstr(mode), gzfileobj
   189                     name, pycompat.sysstr(mode), gzfileobj
   190                 )
   190                 )
   191             else:
   191             else:
   192                 return tarfile.open(name, pycompat.sysstr(mode + kind), fileobj)
   192                 try:
       
   193                     return tarfile.open(
       
   194                         name, pycompat.sysstr(mode + kind), fileobj
       
   195                     )
       
   196                 except tarfile.CompressionError as e:
       
   197                     raise error.Abort(pycompat.bytestr(e))
   193 
   198 
   194         if isinstance(dest, bytes):
   199         if isinstance(dest, bytes):
   195             self.z = taropen(b'w:', name=dest)
   200             self.z = taropen(b'w:', name=dest)
   196         else:
   201         else:
   197             self.z = taropen(b'w|', fileobj=dest)
   202             self.z = taropen(b'w|', fileobj=dest)