[Patches] [ python-Patches-595846 ] Update environ for CGIHTTPServer.py

noreply@sourceforge.net noreply@sourceforge.net
Tue, 20 Aug 2002 17:04:46 -0700


Patches item #595846, was opened at 2002-08-15 23:26
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=595846&group_id=5470

Category: Library (Lib)
Group: Python 2.2.x
Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Brett Cannon (bcannon)
Assigned to: Guido van Rossum (gvanrossum)
Summary: Update environ for CGIHTTPServer.py

Initial Comment:
This patch causes CGIHTTPServer to update os.environ
regardless of how it tries to handle calls (fork,
popen*, etc.).

I discovered this when trying to run Quixote through
CGIHTTPServer and getting errors reported by Quixote
saying that the SCRIPT_NAME environment variable was
not being updated.  I noticed that if self.has_fork was
true, then os.environ was never explicitly updated;
os.execve() has the env dict passed to it but I guess
that is not enough or OS X's os.execve() is broken.

So this patch just calls os.environ.update(env) after
the last change to the env dict but before the method
has decided how it is going to deal with the call.  It
also removes the now extraneous calls previously used.

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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2002-08-20 19:04

Message:
Logged In: YES 
user_id=80475

Backported to 2.2.2.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-20 14:55

Message:
Logged In: YES 
user_id=6380

Thanks! Applied to Python 2.3 in CVS. Somebody can backport
this to 2.2.2.

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

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