From: Christian Herdtweck Date: Tue, 19 Jul 2016 10:54:36 +0000 (+0200) Subject: close fileobj before calling new_volume_handler X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=a3c639ae5c0d772ff4f336792820d8fc84f01625;p=python-delta-tar close fileobj before calling new_volume_handler --- diff --git a/deltatar/tarfile.py b/deltatar/tarfile.py index 1bb56d3..fcb6dcc 100644 --- a/deltatar/tarfile.py +++ b/deltatar/tarfile.py @@ -2740,9 +2740,9 @@ class TarFile(object): tarinfo.volume_offset = tarinfo.size - source_size_left self.volume_tarinfo = tarinfo - # the “new_volume_handler” is supposed to call .close() on the - # “fileobj” _Stream - self.new_volume_handler(self, self.base_name, self.volume_number) + # close current volume file (even if fileobj is external) + self.fileobj.close() + try: if not self.new_volume_handler or\ not callable(self.new_volume_handler):