Message328156
| Author |
mitar |
| Recipients |
aronacher, eryksun, martin.panter, mitar, r.david.murray |
| Date |
2018年10月20日.16:13:56 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1540052037.06.0.788709270274.issue21363@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I have a similar problem that text wrapper is closing the handle, and if I want to make a workaround, it also fails:
buffer = io.Bytes()
with io.TextIOWrapper(buffer, encoding='utf8') as text_buffer:
write_content_to(text_buffer)
text_buffer.flush()
text_buffer.detach()
Now this fails when context manager is trying to close the text_buffer with an error that it is already detached. If I do not detach it, then it closes buffer as well. |
|