Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #47823 > unrolled thread

Re: ValueError: I/O operation on closed file. with python3

Started bySerhiy Storchaka <storchaka@gmail.com>
First post2013-06-12 17:44 +0300
Last post2013-06-12 17:44 +0300
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: ValueError: I/O operation on closed file. with python3 Serhiy Storchaka <storchaka@gmail.com> - 2013-06-12 17:44 +0300

#47823 — Re: ValueError: I/O operation on closed file. with python3

FromSerhiy Storchaka <storchaka@gmail.com>
Date2013-06-12 17:44 +0300
SubjectRe: ValueError: I/O operation on closed file. with python3
Message-ID<mailman.3115.1371057695.3114.python-list@python.org>
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).

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web