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
urrlib2 max_redirections=0 disables redirects #43650
Comments
When using urllib2, I wanted to be able to see all IMHO, if max_redirections is set to 0, redirects should For my personal situation, I copied urllib2 and hacked I saw this issue on WinXP with 2.4.1 and on Linux with |
rus_r_orange: Can you share your patch and tests? |
Senthil/John has this simply slipped under the radar? |
This is an invalid bug report at the moment. In fact, aged. |
Why not? |
John, I was trying to find out what does rfc say on "Client Ignoring the 30X REDIRECT headers". There is no point made on Client's trying to ignore it, instead it said that it should follow the Redirect and must not endlessly loop. Setting max_redirect to 0 is similar to ignoring the redirect request , which I found to be a bad idea under any case. Also, if one has to just see redirect urls coming from http server, it can be done by subclassing the HTTPRedirectHandler and logging the redirects. |
That's silly. A justification of the need for a new feature isn't needed, because this is already-implemented feature that simply does the wrong thing at the edge case. It's not high priority, but it is a bug. |
What should it do? OP expected that it print the redirected url. I don't think that's helpful by setting max_redirections to 0, when it can be achieved in other ways. Also, max_redirections is not exposed (as a parameter or arg) or a documented, how do we define user's expectation when he tries to change it? |
Oops, I hadn't noticed that max_redirections isn't part of the API. In that case, I agree that it's not strictly a bug. I'd also agree it's not very important. FWIW: "want[ing] to see all redirects" is not the same thing as printing URLs -- I assume he simply meant that he wanted .open to return the original response, and not a redirected response. I don't think he meant that he wanted urllib2 itself to allow him to literally see the URLs on his screen, by printing them to stdout (!). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: