[issue1287] os.environ.pop doesn't work

2007-10-26 Thread Georg Brandl

Georg Brandl added the comment:

You're right, fixed that in r58675.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1287] os.environ.pop doesn't work

2007-10-25 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

After reading the change, I think one more small change may be required.

Index: Lib/os.py
===
--- Lib/os.py   (revision 58654)
+++ Lib/os.py   (working copy)
@@ -452,7 +452,7 @@
 del self.data[key]
 def pop(self, key, *args):
 unsetenv(key)
-return self.data.pop(key, *args)
+return self.data.pop(key.upper(), *args)
 def has_key(self, key):
 return key.upper() in self.data
 def __contains__(self, key):

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1287] os.environ.pop doesn't work

2007-10-24 Thread Georg Brandl

Georg Brandl added the comment:

Fixed in r58651 for 2.6.

--
nosy: +georg.brandl
resolution:  -> fixed
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1287] os.environ.pop doesn't work

2007-10-16 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

The following patch solves the problem (with the latest from trunk). I
only tested on Linux. I couldn't reproduce the problem with latest py3k
(again, on Linux).

===
--- Lib/os.py   (revision 58221)
+++ Lib/os.py   (working copy)
@@ -446,6 +446,9 @@
 def __delitem__(self, key):
 unsetenv(key)
 del self.data[key.upper()]
+def pop(self, key):
+unsetenv(key)
+return UserDict.IterableUserDict.pop(self, key)
 def clear(self):
 for key in self.data.keys():
 unsetenv(key)
@@ -513,6 +516,9 @@
 del self.data[key]
 def copy(self):
 return dict(self)
+def pop(self, key):
+unsetenv(key)
+return UserDict.IterableUserDict.pop(self, key)
 
 
 environ = _Environ(environ)

--
nosy: +draghuram

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1287] os.environ.pop doesn't work

2007-10-16 Thread Gustavo Niemeyer

Changes by Gustavo Niemeyer:


--
nosy: niemeyer
severity: normal
status: open
title: os.environ.pop doesn't work
versions: Python 2.1.1, Python 2.1.2, Python 2.2, Python 2.2.1, Python 2.2.2, 
Python 2.2.3, Python 2.3, Python 2.4, Python 2.5, Python 2.6, Python 3.0

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1287] os.environ.pop doesn't work

2007-10-16 Thread Gustavo Niemeyer

New submission from Gustavo Niemeyer:

>>> import os
>>> os.system("echo $ASD")

0
>>> os.environ["ASD"] = "asd"
>>> os.system("echo $ASD")
asd
0
>>> os.environ.pop("ASD")
'asd'
>>> os.system("echo $ASD")
asd
0

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com