Message217278
| Author |
eryksun |
| Recipients |
aronacher, eryksun |
| Date |
2014年04月27日.16:21:14 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1398615674.3.0.74282725447.issue21363@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It works if you detach the buffer beforehand:
>>> import io, sys
>>> stdin = sys.stdin
>>> stdin.flush()
>>> correct_stdin = io.TextIOWrapper(stdin.buffer, 'utf-8')
>>> correct_stdin.readline()
foobar
'foobar\n'
>>> correct_stdin.detach()
<_io.BufferedReader name='<stdin>'>
>>> del correct_stdin
>>> stdin.readline()
foobar
'foobar\n' |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年04月27日 16:21:14 | eryksun | set | recipients:
+ eryksun, aronacher |
| 2014年04月27日 16:21:14 | eryksun | set | messageid: <1398615674.3.0.74282725447.issue21363@psf.upfronthosting.co.za> |
| 2014年04月27日 16:21:14 | eryksun | link | issue21363 messages |
| 2014年04月27日 16:21:14 | eryksun | create |
|