[Python-bugs-list] [ python-Bugs-770601 ] CGIHTTPServer and environment variables (bug + solution)

SourceForge.net noreply@sourceforge.net
Sun, 13 Jul 2003 11:22:52 -0700


Bugs item #770601, was opened at 2003-07-13 20:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=770601&group_id=5470

Category: Python Library
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: vincent delft (vincent_delft)
Assigned to: Nobody/Anonymous (nobody)
Summary: CGIHTTPServer and environment variables (bug + solution)

Initial Comment:
The current CGIHTTPserver cannot handle Environment 
variables. 
 
if you have a simple cgi script printing os.environ, you will see 
that all the "standard" env varaibles are gone. 
 
This is because, the script define a temporary variable called 
"env" and update then ENVIRONMENT via 
os.environ.update(env). 
It's perfect. 
 
BUT 
 
the call to the cgi script is done via the command  
os.execve(scriptfile, args, env) 
and should be done via : 
os.execve(scriptfile, args, os.environ) 
 
This way it works correctly; may be an another methode would 
be better.... 
 
  
 
 
 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=770601&group_id=5470