Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #47823 > unrolled thread
| Started by | Serhiy Storchaka <storchaka@gmail.com> |
|---|---|
| First post | 2013-06-12 17:44 +0300 |
| Last post | 2013-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.
Re: ValueError: I/O operation on closed file. with python3 Serhiy Storchaka <storchaka@gmail.com> - 2013-06-12 17:44 +0300
| From | Serhiy Storchaka <storchaka@gmail.com> |
|---|---|
| Date | 2013-06-12 17:44 +0300 |
| Subject | Re: 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).
Back to top | Article view | comp.lang.python
csiph-web