r8-forks / webapp-improved

Automatically exported from code.google.com/p/webapp-improved
Other
0 stars 0 forks source link

Creating a WSGIApplication from within a RequestHandler.method causes WSGIApplication.request to be set to None #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is because WSGIApplication.__init__ calls self.set_globals(app=self)

Original issue reported on code.google.com by bquin...@google.com on 11 Sep 2012 at 9:14

GoogleCodeExporter commented 9 years ago
I'd suggest two fixes:
1. the set_globals call is removed from WSGIApplication.__init__ (so the active 
application is only set in __call__)
2. RequestContext.__exit__ restores the previous app and request

Any objections?

Original comment by bquin...@google.com on 11 Sep 2012 at 9:15

GoogleCodeExporter commented 9 years ago
Probably issue 51 is a duplicate of this.

Original comment by guido@google.com on 11 Sep 2012 at 9:18

GoogleCodeExporter commented 9 years ago
issue 51 looks related but I don't see where the request state would get 
cleared and cause a problem with get_request().

Original comment by bquin...@google.com on 11 Sep 2012 at 9:29

GoogleCodeExporter commented 9 years ago
I removed the set_globals call from WSGIApplication.__init__ in d962ac4625ce

Having a stack of previous requests/apps is somewhat hard because of the way 
they are wrapped in LocalProxy instances.

Original comment by bquin...@google.com on 13 Sep 2012 at 5:37