[New-bugs-announce] [issue14132] Redirect is not working correctly in urllib2

Ján Janech report at bugs.python.org
Sun Feb 26 16:15:31 CET 2012

New submission from Ján Janech <janech at kios.sk>:

When only the query string is sent by the server as the redirect url, urllib2 redirects to incorrect address.

Error is occuring on the page http://kniznica.uniza.sk/opac. Server sends only the query string part of the uri in the Location header (ie. ?fs=04D07295D4434730A51C95A9F1727373&fn=main). Path is then incorrectly stripped from the original url, and urllib2 redirects to http://kniznica.uniza.sk/?fs=04D07295D4434730A51C95A9F1727373&fn=main.

The error was introduced in the fix of the issue #2464. I think, the attached patch is fixing the error (it is working for me).

components: Library (Lib)
files: urllib2_redirect_fix.patch
keywords: patch
messages: 154356
nosy: janik
priority: normal
severity: normal
status: open
title: Redirect is not working correctly in urllib2
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file24647/urllib2_redirect_fix.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list