Comment 4 for bug 340354

Revision history for this message
Martin Pool (mbp) wrote :

I just hit this again, also while debugging something else

In [7]: t.has('.bzr')
---------------------------------------------------------------------------
RedirectRequested Traceback (most recent call last)

/home/mbp/bzr/doc/<ipython console> in <module>()

/home/mbp/bzr/doc/bzrlib/transport/http/_urllib.py in has(self, relpath)
    155 """Does the target location exist?
    156 """
--> 157 response = self._head(relpath)
    158
    159 code = response.code

/home/mbp/bzr/doc/bzrlib/transport/http/_urllib.py in _head(self, relpath)
    148 request = Request('HEAD', abspath,
    149 accepted_errors=[200, 404])
--> 150 response = self._perform(request)
    151
    152 return response

/home/mbp/bzr/doc/bzrlib/transport/http/_urllib.py in _perform(self, request)
     92 raise errors.RedirectRequested(request.get_full_url(),
     93 request.redirected_to,
---> 94 is_permanent=(code == 301))
     95
     96 if request.redirected_to is not None:

RedirectRequested: http://bazaar.launchpad.net/%7Embp/bzr/doc/.bzr is permanently redirected to http://bazaar.launchpad.net/00/00/8c/55/.bzr/

In [8]: t
Out[8]: <bzrlib.transport.http._urllib.HttpTransport_urllib url=http://bazaar.launchpad.net/%7Embp/bzr/doc/>

This seems to be with Apache's builtin behaviour that if foo is a directory and you ask for '/foo' you immediately get a redirect to '/foo/', and that's interacting somehow with the redirect map.

It's a bit bad that Launchpad gives out redirects to URLs which are then not accepted. (They're not actually 404; they give you a redirection back to the home page which is in some ways more confusing.)