Jason R. Coombs added the comment: As a workaround, I wrapped BytesIO thus and it works for our needs.
class LenientIO(io.BytesIO): """ A version of BytesIO that can accept unicode or bytes. See http://bugs.python.org/issue29809 """ def write(self, value): if isinstance(value, six.text_type): value = value.encode('utf-8') super(LenientIO, self).write(value) I'll recommend we close as wontfix, given the limited impact, unless it's demonstrated elsewhere. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29809> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com