Error when opening zipfiles requests. zipfile.BadZipFile: File is not a zip file #2213
Answered
by
Tyarel8
Tyarel8
asked this question in
Potential Issue
|
After attempting to donwload and extract a zipfile using httpx it throws the following error However, using the exact same code but with the requests module works as intended |
Answered by
Tyarel8
May 9, 2022
Replies: 3 comments 2 replies
|
Could you provide an example that we're able to reproduce? Specifically, including the URL you're using would help here. |
2 replies
|
Solved, I didn't notice that httpx didn't follow redirects by default, that was why it was working with the request module but not with httpx. (follow_redirects=True) |
0 replies
Answer selected by
Tyarel8
|
GZIP, renaming, tracing, and 7zip expressions are the most basic ways to overcome the problem (Zipfile.badzipfile: file is not a zip) in Python. In fact, these two options necessitate the installation of new modules. Read this |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved, I didn't notice that httpx didn't follow redirects by default, that was why it was working with the request module but not with httpx. (follow_redirects=True)