Good points! Uploading to trunk in 5 minutes.
On Oct 31, 4:53 pm, hcvst <hcv...@googlemail.com> wrote:
> line 250: new_environ['wsgi.input']=request.body
>
> But: request.body is None at this stage
>
> Moving the wsgi section in main.py's wsgibase() further down (above
> the load cookies),
> seems to work for me, but please someone that knows the code have a
> look.
> Also, this might be a good place to seek(0) the wsgi.input
> # ##################################################
> # expose wsgi hooks for convenience
> # ##################################################
>
> request.wsgi.environ = environ_aux(environ,request)
> request.wsgi.start_response = lambda status='200', headers=[], \
> exec_info=None, response=response: \
> start_response_aux(status, headers, exec_info, response)
> request.wsgi.middleware = lambda *a: middleware_aux
> (request,response,*a)
>
> # ##################################################
> # load cookies
> # ##################################################
>
> HC
>
> On Oct 31, 9:04 pm, "mr.freeze" <nat...@freezable.com> wrote:
>
> > It's there.
>
> > ...line 248....
> > def environ_aux(environ,request):
> > new_environ = copy.copy(environ)
> > new_environ['wsgi.input']=request.body
> > new_environ['wsgi.version']=1
> > return new_environ
> > .....
> > ...line 300...
> > try:
> > try:
> > ....
> > request.wsgi.environ = environ_aux(environ,request)
>
> > On Oct 31, 1:37 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > It should be
>
> > > request.wsgi.environ['wsgi.input'] = request.body
>
> > > can you check in gluon main.py should should have this line
>
> > > request.wsgi.environ = environ_aux(environ,request)
>
> > > and environ_aux also on main.py defines wsgi.input
>
> > > On Oct 31, 1:22 pm, hcvst <hcv...@googlemail.com> wrote:
>
> > > > Hi Massimo,
>
> > > > I am running Version 1.71.0 (2009-10-31 01:13:28).
> > > > wsgi.environ does not have wsgi.input (for get or post)
> > > > I checked locally and GAE does not find it either.
> > > > I currenty have to add it:
> > > > request.wsgi.environ['wsgi.input'] = request.env.wsgi_input
>
> > > > HC
>
> > > > On Oct 31, 6:41 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > request.env is the web2py environment
>
> > > > > request.wsgi.environ is the environment you want (created by web2py
> > > > > for your app). It has wsgi.input.
>
> > > > > On Oct 31, 9:32 am, hcvst <hcv...@googlemail.com> wrote:
>
> > > > > > Hi Massimo,
>
> > > > > > thanks, this makes wsgi a lot easier - there are a few issues
> > > > > > however:
>
> > > > > > 1. environ['wsgi.input'] does not seem to exist - there is however
> > > > > > request.env.wsgi_input.
> > > > > > 2. Not sure what the wsgi spec says but one has to call seek(0) on
> > > > > > wsgi_input to 'rewind' the buffer when
> > > > > > using Google's webapp for example as Google does not call getvalue()
> > > > > > but read() to get the buffer contents.
> > > > > > 3. The lamda your start_response returns also appears to write to
> > > > > > response.body - Again I am not sure
> > > > > > what the wsgi specs say but usually the call to app(env,
> > > > > > start_response) returns a generator one calls to
> > > > > > get the contents. Google's webapp works nicely with the
> > > > > > response.body.write method though.
>
> > > > > > HC
>
> > > > > > On Oct 31, 1:24 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > > > It fixes some problems introduced by new features in 1.69.1.
>
> > > > > > > It also includes:
> > > > > > > - db(...).select().as_dict()
> > > > > > > - Experimental distributed transactions with mysql, postgresql and
> > > > > > > firebird
> > > > > > > - Improved validators
> > > > > > > - ability to call wsgi apps from actions
>
> > > > > > > def index():
> > > > > > > return somewsgiapp
> > > > > > > (request.wsgi.environ,request.wsgi.start_response)
>
> > > > > > > and to apply wsgi middleware to normal web2py actions
>
> > > > > > > @request.wsgi.middleware(somewsgimiddleware,someother)
> > > > > > > def index(): return 'hello world'
>
> > > > > > > Please report any error.
>
> > > > > > > Thanks to Mr Freeze, Thadeus and Jonathan for help.
>
> > > > > > > Happy Halloween to everybody.
>
> > > > > > > Massimo
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---