You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
assignee=Noneclosed_at=<Date2005-12-31.18:10:31.000>created_at=<Date2005-12-31.16:46:15.000>labels= ['library']
title='urllib2 raises exception when page redirects to itself'updated_at=<Date2005-12-31.18:10:31.000>user='https://bugs.python.org/rpijlman'
Some sites redirect a page to itself, due to a
configuration error or bug. The popular browsers seem
to be forgiving: when a URL redirects to itself, they
break the infinite redirect loop and simply display the
page (verified in IE6 and Firefox 1.5).
urllib2.urlopen() raises an exception in the same
situation: HTTP Error 302: The HTTP server returned a
redirect error that would lead to an infinite loop.
Although this message is technically correct, I think
the situation of a page redirecting to itself should be
handled as a special case. It should abort the redirect
and continue with the current request. Users expect
urllib to be able to access sites that popular browsers
can apparently access without problems.
To reproduce (pick a site with this redirect anomaly):
Forget it. I misunderstood. The reason some sites redirect
to the current page itself, is to first set a cookie.
I retried with cookie support in urllib2 and cookielib in
Python 2.4. With HTTPCookieProcessor installed as opener
urllib2.urlopen worked fine on two different sites that
showed this 'problem'.
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: