I get a tar file in the body of a http post request and I want to extract the contents without first writing the tar file to disc. The file used to be a zip file and i could do
zip = zipfile.ZipFile(StringIO(request.content.read()))
zip.extractall(some_path)
How do i do the same thing using tarfile.TarFile?
I tried
tar = tarfile.open(fileobj = StringIO(self.request.content.read()))
but got the error message:
file could not be opened successfully