Message218632
> The same situations people wrapped streams before on python 2:
>
> * code.py users. Werkzeug's traceback system implements a remote python
> shell through it.
> * any system that wants to unittest shell scripts on a high level.
> * any system that wants to execute arbitrary python code and then
> capture whatever output it did. This is for instance what I see
> Sphinx users frequently do (or doctests)
I see, I misunderstood you. You actually want to get back the bytes
output of e.g. stdout, right?
You could indeed use a TextIOWrapper wrapping a BytesIO object. Or of
course another possibility is to do the encoding yourself, e.g.
sys.stdout.getvalue().encode('utf-8', 'surrogateescape'). |
|
Date |
User |
Action |
Args |
2014-05-15 21:50:57 | pitrou | set | recipients:
+ pitrou, benjamin.peterson, stutzbach, aronacher, r.david.murray, flox, python-dev, hynek, martin.panter |
2014-05-15 21:50:57 | pitrou | link | issue21364 messages |
2014-05-15 21:50:57 | pitrou | create | |
|