[Patches] [ python-Patches-550804 ] Make os.environ.copy() return a copy

noreply@sourceforge.net noreply@sourceforge.net
Tue, 30 Apr 2002 14:58:30 -0700


Patches item #550804, was opened at 2002-04-30 21:58
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=550804&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gustavo Niemeyer (niemeyer)
Assigned to: Nobody/Anonymous (nobody)
Summary: Make os.environ.copy() return a copy

Initial Comment:
As reported by Jeff Epler in python-list: 
 
""" 
Under Python2.1 and earlier (back to 1.5.2): 
>>> import os 
>>> os.environ.copy()['COPY_HUH'] = "not really" 
>>> print os.environ['COPY_HUH'] 
not really 
 
Under even 2.3a0 (CVS): 
>>> import os 
>>> os.environ.copy()['COPY_HUH'] = "not really" 
>>> os.system("echo $COPY_HUH") 
not really 
0 
""" 
 
This patch fixes this behavior, by returning a real 
dictionary from the copy() operation. 

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

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