poetry lock: [TooManyRedirects] Exceeded 30 redirects.

Created on 7 Oct 2019  路  2Comments  路  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macos mojave
  • Poetry version: 1.0.0b1

Issue

On poetry lock, anything that depends on mypy (and through mypy, mypy_extensions) results in 301

[tool.poetry]
name = "foo"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dev-dependencies]
mypy = "*"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

The error happens here:

  File "$HOME/.poetry/lib/poetry/_vendor/py3.6/requests/sessions.py", line 166, in resolve_redirects
    raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects, response=resp)

Printing the url and response text inside that block, I see
https://pypi.org/pypi/mypy-extensions/json {"message": "The resource has been moved to /pypi/mypy_extensions/json; you should be redirected automatically.\n\n", "code": "301 Moved Permanently", "title": "Moved Permanently"}
and printing outside that block, I see it flipping back and forth between mypy_extensions and mypy-extensions.

In the browser, both _ and - result in my ending up at mypy-extensions, as does running it in a python prompt

>>> requests.get('https://pypi.org/pypi/mypy-extensions/json').url
'https://pypi.org/pypi/mypy-extensions/json'
>>> requests.get('https://pypi.org/pypi/mypy_extensions/json').url
'https://pypi.org/pypi/mypy-extensions/json'

I can't tell if I ought to submit this against warehouse instead, because of the apparent behavior coming from the requests, but i can't reproduce outside the context of this poetry call.

Bug

Most helpful comment

poetry cache:clear --all pypi

All 2 comments

poetry cache:clear --all pypi

That worked, thanks! (poetry cache clear --all pypi in 1.0b1). Was this caused by a change on pypi?

With that knowledge, I searched and found https://github.com/sdispater/poetry/issues/728, my bad :(

Is this something that ought to be in the docs somewhere? the cache command isn't documented

Was this page helpful?
0 / 5 - 0 ratings