¿Es normal que python io.BytesIO.getvalue()
devuelva str en lugar de bytes?¿Es normal que python's io.BytesIO.getvalue() devuelva str en lugar de bytes?
Python 2.7.1 (r271:86832, Jun 13 2011, 14:28:51)
>>> import io
>>> a = io.BytesIO()
>>> a
<_io.BytesIO object at 0x10f9453b0>
>>> a.getvalue()
''
>>> print type(a.getvalue())
<type 'str'>
>>>
¿Debo presentar un error?
OMFG, y cómo se espera que resuelva un error como http://dev.pyamf.org/ticket/823 - donde necesito estar seguro de obtener bytes y no cadenas, porque más adelante (en python httplib) intenta agregar mis datos a una cadena Unicode. – sorin