This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aronacher
Recipients aronacher, benjamin.peterson, flox, hynek, martin.panter, pitrou, python-dev, r.david.murray, stutzbach
Date 2014-05-15.20:44:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400186696.42.0.554658773365.issue21364@psf.upfronthosting.co.za>
In-reply-to
Content
To avoid further problems may I also recommend documenting how exactly people are supposed to wrap sys.stdout and so forth.  Clearly putting a StringIO there is insufficient as StringIO does not have a buffer.

Something like this maybe?

import io
buf = io.BytesIO()
sys.stdout = io.TextIOWrapper(buf,
    encoding='utf-8',
    errors='strict', # or surrogate-escape as this is the default for stdout now? not sure
    line_buffering=True
)
History
Date User Action Args
2014-05-15 20:44:56aronachersetrecipients: + aronacher, pitrou, benjamin.peterson, stutzbach, r.david.murray, flox, python-dev, hynek, martin.panter
2014-05-15 20:44:56aronachersetmessageid: <1400186696.42.0.554658773365.issue21364@psf.upfronthosting.co.za>
2014-05-15 20:44:56aronacherlinkissue21364 messages
2014-05-15 20:44:56aronachercreate