There were two simple errors in urllib2's redirection code. In two cases, req.method was being invoked when the author meant req.get_method. The second error was the failure to make the redirected URL available to the redirect handler; I passed it as a parameter, but it could have been added as another instance variable.