tarobj.close()
os.unlink("big")
- fo = open("sample.tar.gz", 'rb')
+ fo = open("sample.tar.gz", 'rb') # will not be released on tarfile.close()
fo.seek(pos)
tarobj = TarFile.open(mode="r#gz", fileobj=fo)
tarobj.extract(tarobj.next())
tarobj.close()
+ fo.close()
assert os.path.exists("big")
assert hash == self.md5sum("big")
os.unlink("small2")
# extract only the "small" file
- fo = open("sample.tar.gz", 'rb')
+ fo = open("sample.tar.gz", 'rb') # will not be released on tarfile.close()
fo.seek(pos)
tarobj = TarFile.open(mode="r#gz", fileobj=fo)
tarobj.extract(tarobj.next())
tarobj.close()
+ fo.close()
assert os.path.exists("small")
assert hash['small'] == self.md5sum("small")
tarobj.open_volume(volume_path)
# extract only the "small" file
- fo = open("sample.tar.gz", 'rb')
+ fo = open("sample.tar.gz", 'rb') # will not be released on tarfile.close()
fo.seek(pos)
tarobj = TarFile.open(mode="r#gz", fileobj=fo,
new_volume_handler=new_volume_handler_fo)
tarobj.extract(tarobj.next())
tarobj.close()
+ fo.close()
assert os.path.exists("big")
assert hash['big'] == self.md5sum("big")