M
Michael Foord
I've come across a couple of 'features' in Python standard libraries -
and I'm not sure if they're meant to be there... or if they're bugs...
One in urllib2 and one in cgi.
Traceback (most recent call last):
File "<pyshell#11>", line 1, in -toplevel-
for entry in i: print entry
File "D:\PYTHON23\lib\rfc822.py", line 390, in __getitem__
return self.dict[name.lower()]
AttributeError: 'int' object has no attribute 'lower'
and in cgi (a result that happens in live CGI as well as interactive
sessions....) :
Traceback (most recent call last):
File "<pyshell#3>", line 1, in ?
for entry in a: print entry
File "C:\PYTHON22\lib\cgi.py", line 550, in __getitem_
raise KeyError,
keyKeyError: 0
You can get round the cgi bug because :
for entry in a.keys(): print entry
works fine - but it's a bit annoying.
(Admittedly my server has python 2.2, but the urllib2 bug occurs in
Python 2.3.4 as well I think).
Regards,
Fuzzy
http://www.voidspace.org.uk/atlantibots/pythonutils.html
and I'm not sure if they're meant to be there... or if they're bugs...
One in urllib2 and one in cgi.
Traceback (most recent call last):
File "<pyshell#11>", line 1, in -toplevel-
for entry in i: print entry
File "D:\PYTHON23\lib\rfc822.py", line 390, in __getitem__
return self.dict[name.lower()]
AttributeError: 'int' object has no attribute 'lower'
and in cgi (a result that happens in live CGI as well as interactive
sessions....) :
Traceback (most recent call last):
File "<pyshell#3>", line 1, in ?
for entry in a: print entry
File "C:\PYTHON22\lib\cgi.py", line 550, in __getitem_
raise KeyError,
keyKeyError: 0
You can get round the cgi bug because :
for entry in a.keys(): print entry
works fine - but it's a bit annoying.
(Admittedly my server has python 2.2, but the urllib2 bug occurs in
Python 2.3.4 as well I think).
Regards,
Fuzzy
http://www.voidspace.org.uk/atlantibots/pythonutils.html