Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 952

Show
Ignore:
Timestamp:
01/31/06 10:08:19
Author:
dowski
Message:

When running under _cphttpserver, request.wsgi_environ is now set to an empty dictionary. It will still evaluate as boolean False, but will allow for the following code:

val = cherrypy.request.wsgi_environ.get('SOME_VAR', 'some default')

Rather than:

if cherrypy.request.wsgi_environ:

val = cherrypy.request.wsgi_environ['SOME_VAR']
else:
val = 'some default'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cphttpserver.py

    r950 r952  
    8181            request.multithread = cherrypy.config.get("server.thread_pool") > 1 
    8282            request.multiprocess = False 
    83             request.wsgi_environ = False 
     83            request.wsgi_environ = {} 
    8484            response = request.run(self.raw_requestline, self._headerlist(), 
    8585                                   self.rfile) 
  • trunk/docs/book/xml/apireference.xml

    r951 r952  
    9090        <section> 
    9191            <title>cherrypy.request.wsgi_environ</title> 
    92             <para>This attribute is a dictionary containing the WSGI environment for the request.  In non-WSGI settings, it is set to False.</para> 
     92            <para>This attribute is a dictionary containing the WSGI environment for the request.  In non-WSGI settings (i.e., running under _cphttpserver), it is an empty dictionary.</para> 
    9393        </section> 
    9494        <section> 

Hosted by WebFaction

Log in as guest/cpguest to create tickets