comparison mercurial/archival.py @ 45083:3a6ec080b521

merge with stable
author Augie Fackler <augie@google.com>
date Mon, 13 Jul 2020 13:06:12 -0400
parents a56ba57c837d 2c0043977b6d
children 89a2afe31e82
comparison
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)