[New-bugs-announce] [issue13650] urllib HTTPRedirectHandler does not implement documented behavior

tom kel report at bugs.python.org
Thu Dec 22 17:14:51 CET 2011


New submission from tom kel <tomkel01 at gmail.com>:

Python 3.2.2, 
Here is a blokck of code from the HTTPRedirectHandler:

        m = req.get_method()
        if (not (code in (301, 302, 303, 307) and m in ("GET", "HEAD")
            or code in (301, 302, 303) and m == "POST")):
            raise HTTPError(req.full_url, code, msg, headers, fp)

        # Strictly (according to RFC 2616), 301 or 302 in response to
        # a POST MUST NOT cause a redirection without confirmation
        # from the user (of urllib.request, in this case).  In practice,
        # essentially all clients do redirect in this case, so we do
        # the same.

As you can see, the documentation and the implementation are contradictory.

----------
components: Library (Lib)
messages: 150102
nosy: tom.kel
priority: normal
severity: normal
status: open
title: urllib HTTPRedirectHandler does not implement documented behavior
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13650>
_______________________________________


More information about the New-bugs-announce mailing list