[New-bugs-announce] [issue4608] urllib.request.urlopen does not return an iterable object

Jakub Wilk report at bugs.python.org
Tue Dec 9 13:13:42 CET 2008


New submission from Jakub Wilk <ubanus at users.sf.net>:

$ cat urltest2.5
#!/usr/bin/python2.5
from urllib2 import urlopen
for line in urlopen('http://python.org/'):
        print line
        break

$ ./urltest2.5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


$ cat urltest3.0
#!/usr/bin/python3.0
from urllib.request import urlopen
for line in urlopen('http://python.org/'):
        print(line)
        break

$ ./urltest3.0
Traceback (most recent call last):
  File "./urltest3.0", line 3, in <module>
    for line in urlopen('http://python.org/'):
TypeError: 'addinfourl' object is not iterable

----------
components: Library (Lib)
messages: 77405
nosy: jwilk, pl
severity: normal
status: open
title: urllib.request.urlopen does not return an iterable object
type: behavior
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4608>
_______________________________________


More information about the New-bugs-announce mailing list