Something strange with python 2.2.1 under RedHat 8.0

Nagy László Zsolt nagylzs at
Thu Jun 26 19:05:19 CEST 2003

>I can't iterate over os.environ, while a 'hand-made' dictionary works.  It
>works fine with python 2.2.3 under FreeBSD 4.8. I looked through the
>release notes but didn't find anything I thought applied, so I guess I'd
>just like to know if this is something peculiar to my system, or is it
>more wide-spread? 
I think it is more wide-spread. :-(

Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import os
 >>> os.environ
{'TMP': 'D:\\DOCUME~1\\Laci\\LOCALS~1\\Temp', 'USERNAME': 'Laci', 
\\system32\\cmd.exe', 'USERDOMAIN': 'EARTH', 'PYTHONPATH': 
Projects\\GeochemSource\\WebSpiders\\Lib', 'COMMONPROGRAMFILES': 
'D:\\Program Fi
les\\Common Files', 'PROCESSOR_IDENTIFIER': 'x86 Family 6 Model 8 
Stepping 1, Au
thenticAMD', 'PROGRAMFILES': 'D:\\Program Files', 'PROCESSOR_REVISION': 
.WSF;.WSH', 'CLIENTNAME': 'Console', 'PATH': 
\Python22', 'WINDIR': 'D:\\WINDOWS', 'TEMP': 
', 'HOMEDRIVE': 'D:', 'ALLUSERSPROFILE': 'D:\\Documents and 
Settings\\All Users'
'1', 'APPDATA': 'D:\\Documents and Settings\\Laci\\Application Data', 
_LEVEL': '6', 'SESSIONNAME': 'Console', 'HOMEPATH': '\\Documents and 
aci', 'OS': 'Windows_NT', 'USERPROFILE': 'D:\\Documents and Settings\\Laci'}
 >>> for i in os.environ:
... print i
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "D:\Python22\Lib\", line 387, in __getitem__
AttributeError: 'int' object has no attribute 'upper'
 >>> d = {1:'',2:'sadf',3:2134}
 >>> for i in d:
... print i
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list