[issue1755841] Patch for [ 735515 ] urllib2 should cache 301 redir

Senthil Kumaran report at bugs.python.org
Tue Jan 5 15:32:09 CET 2010


Senthil Kumaran <orsenthil at gmail.com> added the comment:

Antoine: I got your point. Yes, I was missing the purpose of the redirection itself and the patch was wrong.

If the 301 is to be cached, the cache map should be maintained at the higher level in order for the further requests to refer to.
I have created a redirect_map at OpenerDirector level, and this will be populated by the RedirectHandler and will be referred to at time of creation of Request. This is along the correct lines, I could verify it with simple scripts and check the fetches from cache map for repeated redirects.

Your comments please.

----------
Added file: http://bugs.python.org/file15745/urllib2-301-redirection-proper.diff

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


More information about the Python-bugs-list mailing list