def str2fp(data):
    """
    Convert bytes data to file handle object (StringIO or BytesIO).

    :arg data: String data to transform
    """
    return BytesIO(bytearray(data, const.ENCODING)) if const.PY3 else StringIO(data)
def str2fp(data):
    """
    Convert bytes data to file handle object (StringIO or BytesIO).

    :arg data: String data to transform
    """
    return BytesIO(bytearray(data, const.ENCODING)) if const.PY3 else StringIO(data)
def str2fp ( data ) : return BytesIO ( bytearray ( data , const . ENCODING ) ) if const . PY3 else StringIO ( data )
Convert bytes data to file handle object (StringIO or BytesIO).

    :arg data: String data to transform
Convert bytes data to file handle object ( StringIO or BytesIO ) .