Skip to content

Fix handling errors 401, 403 when looking for repositories#3337

Merged
abn merged 2 commits into
python-poetry:masterfrom
cereblanco:issue-3303
Mar 25, 2021
Merged

Fix handling errors 401, 403 when looking for repositories#3337
abn merged 2 commits into
python-poetry:masterfrom
cereblanco:issue-3303

Conversation

@cereblanco
Copy link
Copy Markdown
Contributor

@cereblanco cereblanco commented Nov 7, 2020

Pull Request Check List

fixes error handling related to: #3303

  • Added tests for changed code.
  • Updated documentation for changed code.

@MeanderingCode
Copy link
Copy Markdown

MeanderingCode commented Dec 11, 2020

My experience of our pypicloud returning an HTTP 401 is that requests raises an HTTPError, meaning that I believe your response status code should go in the except HTTPError block.

But that aside, this does not fix the authentication problems some (myself included) are finding with, for example, a pypicloud serving private packages directly with HTTP Basic auth or via authenticated AWS S3 URLs.

See #3041

Perhaps proper error handling, as this addresses, is separate, but I wanted to ensure you had more context.

EDIT: Read more code and realized authentication is not related to this.

@MeanderingCode
Copy link
Copy Markdown

Looks like the exception is raised manually, below your conditional, so I believe I spoke in error.

@jensgustafsson
Copy link
Copy Markdown

What's the status on this PR?

Copy link
Copy Markdown
Member

@abn abn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @cereblanco. This might require a rebase as well.

Comment thread tests/repositories/test_legacy_repository.py Outdated
Comment thread tests/repositories/test_legacy_repository.py Outdated
Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
@kasteph
Copy link
Copy Markdown
Member

kasteph commented Mar 25, 2021

Hi @cereblanco this PR still needs to be rebased because of the breaking CI build. Thank you in advance!

@abn abn merged commit 3c9ced2 into python-poetry:master Mar 25, 2021
@erdemuysal
Copy link
Copy Markdown

Hi 🤚

How can I get information about when the new version with this change will be released?
We need this in our scenario.

@cereblanco cereblanco deleted the issue-3303 branch May 18, 2021 07:52
@ogunoz
Copy link
Copy Markdown

ogunoz commented Sep 21, 2021

@erdemuysal I faced the same issue. They approved the MR for poetry 1.2.0 release

Currently it is available only as an alpha release. It solved my problem.
You can update your poetry with either:
poetry self update --preview
or:
pip install https://github.com/python-poetry/poetry/releases/download/1.2.0a2/poetry-1.2.0a2-py3-none-any.whl

@judahrand
Copy link
Copy Markdown

Is there a reason not to back port this to 1.11? @stephsamson

@1ace
Copy link
Copy Markdown
Contributor

1ace commented Feb 8, 2022

@abn @sdispater Could this simple and non-intrusive fix be backported to 1.1.x please? Thank you 🙂

@github-actions
Copy link
Copy Markdown

This pull request 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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants