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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 02 May 2002 10:39:56 -0700


Patches item #550804, was opened at 2002-04-30 23: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: Closed
>Resolution: Accepted
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. 

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

>Comment By: Martin v. Löwis (loewis)
Date: 2002-05-02 19:39

Message:
Logged In: YES 
user_id=21627

Thanks for the patch; applied as os.py 1.56.

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

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