Possible Duplicate:
should I call close() after urllib.urlopen()?
Do objects created by urllib2.urlopen() represent a constant connection?
I haven't seen any code samples in the Python documentation that indicate it's necessary to close connections to remote servers.
import urllib2
handle = urllib2.urlopen('http://download.thinkbroadband.com/5MB.zip')
# ... do whatever
In the code above It feels wrong to not call close()
on handle
when I'm done. What's happening here? Is it necessary to close the connection manually or is it closed for me?