[Python-bugs-list] [ python-Bugs-605731 ] os.environ does not support __iter__.
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 06 Sep 2002 12:10:13 -0700
Bugs item #605731, was opened at 2002-09-06 13:32
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=605731&group_id=5470
Category: Python Library
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: R. David Murray (rdmurray)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: os.environ does not support __iter__.
Initial Comment:
os.environ (on FreeBSD at least) apparently uses UserDict.
When bug 448153 was fixed, UserDict lost its __iter__ method,
and thus the environ dict became non-iterable. os.environ
should either use IterableUserDict or, more likely, dictionary.
----------------------------------------------------------------------
>Comment By: Raymond Hettinger (rhettinger)
Date: 2002-09-06 14:10
Message:
Logged In: YES
user_id=80475
I can fix this easily enough with a one line change to os.py:
- class _Environ(UserDict.UserDict):
+ class _Environ(UserDict.IterableUserDict):
The question is whether the original bug fix, 448153 was
the right thing to do. Are more users reasonably relying
on UserDict being iterable or are more abusing the non-
terable form? Which makes sense for the long run?
If you want the simple fix, please re-assign back to me.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=605731&group_id=5470