12.06.13 10:26, Peter Otten написав(ла):
@contextmanager def my_urlopen(url): resp = urlopen(url) yield io.TextIOWrapper(resp.fp)
with urlopen(url) as resp: yield io.TextIOWrapper(resp)Note that last bugfix releases (i.e. 3.3.1) are needed. There was a bug with io.TextIOWrapper and HTTPResponse (http://bugs.python.org/issue16723).
-- http://mail.python.org/mailman/listinfo/python-list