When I want to decompression a zipfile from internet, there is a error like zipfile.badzipfile: file is not a zip file
.
here is my code:
response = requests.get('www.example.com/somefile.zip', stream=True)
response.raw.decode_content = True
with zipfile.ZipFile(response.raw)as zip_file:
# do something.
PS: Because this zipfile is very large, I don't want to waste memory, so I didn't use io.BytesIO(resp.content)
as there 1 says.