Massimo,

I'm not sure anything can be done about it from within web2py (though
Jonathan could certainly answer that better than I).  It appears to be
a limitation of the rocket web server.  It may need to be taken up
with the development team working on Rocket.  Of course, if it's a
problem with Rocket it could be a problem with other web servers.

It seems like the safest thing would be to use one of the environment
variables required by the PEP.  PATH_INFO almost works, but it is
returning the URL _after_ it has been rewritten by routes.py.  Maybe
we can intercept and set the variable before the url is rewritten?
Maybe we would only do that if the web server did not define a
request_uri environment variable?

On Mon, Aug 16, 2010 at 2:56 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
> This is important and should be fixed. we will look into it. Perhaps
> Jonathan who has worked on routes extensively can look into this.
>
> Massimo
>
> On Aug 16, 1:54 pm, mwolfe02 <michael.joseph.wo...@gmail.com> wrote:
>> Just tested this in my production environment (apache) and it works as
>> expected.  I'm having the problem in my dev environment which is
>> running the built-in rocket server on windows.  It looks like the
>> Rocket server is not providing request_uri as apache with mod_wsgi
>> does.
>>
>> If you just output the contents of request.env in the two different
>> environments you will see the differences.  According to the WSGI PEP
>> (http://www.python.org/dev/peps/pep-0333/#environ-variables),
>> request_uri is not a required environment variable.  I don't think the
>> 'requested_uri' functionality for routes_onerror is mentioned in the
>> documentation anywhere, but if and when it is a caveat about its
>> limitations with respect to different web servers should be mentioned.
>>
>> Unfortunately, I spent several hours trying to figure out what I was
>> doing wrong before realizing it was not something I had any control
>> over.  I hope I can save someone else some trouble in the future.
>>
>> -Mike
>>
>> On Aug 16, 12:52 pm, mwolfe02 <michael.joseph.wo...@gmail.com> wrote:
>>
>> > I'm trying to use routes_onerror, but requested_uri keeps coming
>> > through as None (subject of this e-mail is the query string from the
>> > redirect).  I searched through the source code and could not find
>> > where this is supposed to be set.  I stepped through using WinPDB and
>> > there is simply no entry in request.env for request_uri.  There is an
>> > entry for path_info which appears to be the re-written uri (ie, post
>> > routes.py processing).
>>
>> > I'm running from trunk.  Please let me know what other info is needed
>> > to troubleshoot.
>>
>> > Thanks,
>> > Mike

Reply via email to