[Python-checkins] python/nondist/peps pep-0333.txt,1.12,1.13

pje at users.sourceforge.net pje at users.sourceforge.net
Thu Sep 16 03:56:47 CEST 2004


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7190

Modified Files:
	pep-0333.txt 
Log Message:
Fix some minor errors found during actual implementation of 
example code.

Index: pep-0333.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0333.txt,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- pep-0333.txt	15 Sep 2004 20:41:16 -0000	1.12
+++ pep-0333.txt	16 Sep 2004 01:56:44 -0000	1.13
@@ -198,8 +198,7 @@
 
     def run_with_cgi(application):
 
-        environ = {}
-        environ.update(os.environ)
+        environ = dict(os.environ.items())
         environ['wsgi.input']        = sys.stdin
         environ['wsgi.errors']       = sys.stderr
         environ['wsgi.version']      = (1,0)
@@ -207,9 +206,6 @@
         environ['wsgi.multiprocess'] = True
         environ['wsgi.last_call']    = True
 
-        # XXX really should set defaults for WSGI-required variables;
-        #     see "environ Variables" section below
-
         if environ.get('HTTPS','off') in ('on','1'):
             environ['wsgi.url_scheme'] = 'https'
         else:
@@ -251,6 +247,8 @@
         try:
             for data in result:
                 write(data)
+            if not headers_sent:
+                write('')   # force headers to be sent
         finally:
             if hasattr(result,'close'):
                 result.close()



More information about the Python-checkins mailing list