On Tue, Feb 3, 2009 at 2:08 PM, Brad Miller <millb...@luther.edu> wrote: > Here's the iteration problem: > 'b\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\\n\'' >>>> for line in page: > print(line) > Traceback (most recent call last): > File "<pyshell#10>", line 1, in <module> > for line in page: > TypeError: 'addinfourl' object is not iterable > Why is this not iterable anymore? Is this too a bug? What the heck is an > addinfourl object?
See http://bugs.python.org/issue4608. > > 5. Finally, I see that a bytes object has some of the same methods as > strings. But the error messages are confusing. >>>> line > b' "http://www.w3.org/TR/html4/loose.dtd">\n' >>>> line.find('www') > Traceback (most recent call last): > File "<pyshell#18>", line 1, in <module> > line.find('www') > TypeError: expected an object with the buffer interface >>>> line.find(b'www') > 11 > Why couldn't find take string as a parameter? See http://bugs.python.org/issue4733 -- Regards, Benjamin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com