Issue1181
Created on 2007-09-19 21:38 by horcicka, last changed 2007-09-20 17:59 by georg.brandl.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
os.py.patch
|
horcicka,
2007-09-19 21:38
|
|
|
|
| msg56048 (view) |
Author: Martin Horcicka (horcicka) |
Date: 2007-09-19 21:38 |
|
This patch makes os.environ.clear() to have the same effect as:
for name in os.environ.keys():
del os.environ[name]
I believe that most people expect the effects to be the same anyway.
The practical benefit is a simpler redefinition of the whole environment
if desired (e.g. in scripts run via sudo on unix systems).
|
| msg56060 (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-09-20 17:20 |
|
Sounds like a good idea. Anyone care to check it in?
|
| msg56061 (view) |
Author: Raghuram Devarakonda (draghuram) |
Date: 2007-09-20 17:46 |
|
Shouldn't the first clear() in the patch say "del
self.data[key.upper()]" instead of "del self.data[key]"? I also think
the patch should include doc change.
|
| msg56063 (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-09-20 17:52 |
|
On 9/20/07, Raghuram Devarakonda <report@bugs.python.org> wrote:
> Shouldn't the first clear() in the patch say "del
> self.data[key.upper()]" instead of "del self.data[key]"? I also think
> the patch should include doc change.
I don't think so -- it goes over self.data.keys() which means they are
already uppercase.
All of this would be unnecessary if clear() in UserDict were to be changed to
for key in self.keys(): del self[key]
But that's a much more pervasive change...
|
| msg56064 (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2007-09-20 17:59 |
|
Committed, incl. docs, as rev. 58221.
|
|
| Date |
User |
Action |
Args |
| 2007-09-20 17:59:03 | georg.brandl | set | status: open -> closed assignee: georg.brandl resolution: accepted messages:
+ msg56064 nosy:
+ georg.brandl |
| 2007-09-20 17:52:17 | gvanrossum | set | messages:
+ msg56063 |
| 2007-09-20 17:46:04 | draghuram | set | messages:
+ msg56061 |
| 2007-09-20 17:20:11 | gvanrossum | set | nosy:
+ gvanrossum messages:
+ msg56060 |
| 2007-09-20 14:13:49 | draghuram | set | nosy:
+ draghuram |
| 2007-09-19 21:44:16 | jafo | set | priority: normal keywords:
+ patch |
| 2007-09-19 21:38:22 | horcicka | create | |
|