Message138690
well, urlopen does return an file like object for socket connection which closes itself when it goes out of scope, as you raised this bug, I think a more explicit context manager like behavior can be tried. But I am afraid that it would complex to implement with the module than it sounds.
I see some example illustrated like this:
http://stackoverflow.com/questions/1522636/should-i-call-close-after-urllib-urlopen
import contextlib
with contextlib.closing(urllib.urlopen(u)) as x:
...use x at will here...
But it would be good to have this ticket as a feature request open. |
|
Date |
User |
Action |
Args |
2011-06-20 08:10:20 | orsenthil | set | recipients:
+ orsenthil, eric.araujo, mcjeff |
2011-06-20 08:10:20 | orsenthil | set | messageid: <1308557420.03.0.87595786668.issue12365@psf.upfronthosting.co.za> |
2011-06-20 08:10:19 | orsenthil | link | issue12365 messages |
2011-06-20 08:10:19 | orsenthil | create | |
|