Python3: Is this a bug in urllib?

Justin Ezequiel justin.mailinglists at gmail.com
Wed Oct 20 20:43:12 EDT 2010


On Oct 20, 8:32 pm, Justin Ezequiel <justin.mailingli... at gmail.com>
wrote:
> On Oct 20, 12:47 am, Johannes Bauer <dfnsonfsdu... at gmx.de> wrote:
>
>
>
> > >>> from urllib import request; request.URLopener().open("http://google.de")
>
> aren't you supposed to call read on the return value of open?
> i.e.,
> .read()

better yet,
f = request.URLopener().open("http://google.de")
f.read()
f.close()



More information about the Python-list mailing list