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

Fix #2207 #2210

Merged
merged 1 commit into from
Sep 9, 2014
Merged

Fix #2207 #2210

merged 1 commit into from
Sep 9, 2014

Conversation

sigmavirus24
Copy link
Contributor

@Lukasa wrote the fix in #2207

With this, the expected behaviour is restored (a TooManyRedirects error);

>>> import requests
>>> r = requests.get('http://www.dx.com/p/-268479')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./requests/api.py", line 59, in get
    return request('get', url, **kwargs)
  File "./requests/api.py", line 48, in request
    return session.request(method=method, url=url, **kwargs)
  File "./requests/sessions.py", line 451, in request
    resp = self.send(prep, **send_kwargs)
  File "./requests/sessions.py", line 583, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "./requests/sessions.py", line 583, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
  File "./requests/sessions.py", line 111, in resolve_redirects
    raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects)
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

@Lukasa wrote the fix in psf#2207
@Lukasa
Copy link
Member

Lukasa commented Sep 7, 2014

I'm an obvious +1. 🍰 🌠

@kevinburke
Copy link
Contributor

should we add a test for this ?

@sigmavirus24
Copy link
Contributor Author

should we add a test for this ?

I'm wont to add a test that will cause our tests to slow-down and may eventually break the tests (if the domain in the original bug fixes its redirects).

Lukasa added a commit that referenced this pull request Sep 9, 2014
@Lukasa Lukasa merged commit 5e94c81 into psf:master Sep 9, 2014
@sigmavirus24 sigmavirus24 deleted the bug/2207 branch September 9, 2014 15:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants