Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to install package from work private repo #3880

Closed
3 tasks done
beauremus opened this issue Apr 6, 2021 · 3 comments
Closed
3 tasks done

Not able to install package from work private repo #3880

beauremus opened this issue Apr 6, 2021 · 3 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@beauremus
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-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 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

at ~/.poetry/lib/poetry/utils/env.py:1074 in _run
      1070│                 output = subprocess.check_output(
      1071│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1072│                 )
      1073│         except CalledProcessError as e:
    → 1074│             raise EnvCommandError(e, input=input_)
      1075│ 
      1076│         return decode(output)
      1077│ 
      1078│     def execute(self, bin, *args, **kwargs):

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.

The issue is in how the file is downloaded. Line 672 in poetry/installation/executor.py uses iter_content but the requests documentation says

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

@beauremus beauremus added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 6, 2021
@dimbleby
Copy link
Contributor

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.

@finswimmer finswimmer closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2022
@beauremus
Copy link
Author

It just means I'm not using Poetry.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants