You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that these issues are related to mine, #1851 and #517.
When I try to install a package from our work repo, pip tells me that it can't install a non-gzip file.
When pip gets called to install the downloaded package from a simple repo, I get a stack saying errored with the following return code 2, OSError: Not a gzipped file (b'./'), During handling of the above exception, another exception occurred:, tarfile.ReadError: not a gzip file
This isn't the issue; it's the symptom. pip doesn't know what to do with the downloaded POSIX archive. I used file to tell me that it's a POSIX archive and not a gzip.
Note
An important note about using Response.iter_content versus Response.raw. Response.iter_content will automatically decode the gzip and deflate transfer-encodings. Response.raw is a raw stream of bytes – it does not transform the response content. If you really need access to the bytes as they were returned, use Response.raw.
So, using raw.stream instead seems like the best option.
I'm willing to open a PR if this is the correct path forward.
Thanks
The text was updated successfully, but these errors were encountered:
you have certainly misunderstood something. That requests documentation is talking about the transfer encoding, it is not not saying that requests will present you with an unzipped file even though the server provided a zipped file.
18 months later I guess you have either sorted this our or don't care any more and this should be closed.
-vvv
option).Issue
I believe that these issues are related to mine, #1851 and #517.
When I try to install a package from our work repo,
pip
tells me that it can't install a non-gzip file.When
pip
gets called to install the downloaded package from a simple repo, I get a stack sayingerrored with the following return code 2
,OSError: Not a gzipped file (b'./')
,During handling of the above exception, another exception occurred:
,tarfile.ReadError: not a gzip file
This isn't the issue; it's the symptom.
pip
doesn't know what to do with the downloaded POSIX archive. I usedfile
to tell me that it's a POSIX archive and not a gzip.The issue is in how the file is downloaded. Line 672 in poetry/installation/executor.py uses
iter_content
but therequests
documentation saysSo, using
raw.stream
instead seems like the best option.I'm willing to open a PR if this is the correct path forward.
Thanks
The text was updated successfully, but these errors were encountered: