On Sun, Apr 26, 2009 at 09:35, Max Ischenko <[email protected]> wrote:

> It seems to go as following: the HTTPNotFound gets intercepted,
> StatusCodeRedirects creates "internal redirect" to /error/document/ but
> forwarding to this url fails for some reason. I have turned on DEBUG
> logging, here is what happens:
>

I found it.

The defaul path argument in StatusCodeRedirects is /error/document (not
absent trailing slash). My routing config has .append_slashes = True so when
it tries to lookup this path routes tells it 301 redirect to
/error/document/ (with a slash). And since there is no one to follow it, it
is returned as a wsgi response for browser to display.

Unsure whether this could be called a pylons bug or not.

As a workaround, I now have to override path= argument like this:

        if debug_enabled:
            app = StatusCodeRedirect(app, path='/error/document/')
        else:
            app = StatusCodeRedirect(app, [401, 403, 404, 500],
path='/error/document/')

Max.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to