diff --git a/thriftpy/protocol/binary.py b/thriftpy/protocol/binary.py index dfd4553..7ba21f7 100644 --- a/thriftpy/protocol/binary.py +++ b/thriftpy/protocol/binary.py @@ -252,7 +252,7 @@ def read_val(inbuf, ttype, spec=None, decode_response=True): return [] for i in range(sz): - result.append(read_val(inbuf, v_type, v_spec)) + result.append(read_val(inbuf, v_type, v_spec, decode_response)) return result elif ttype == TType.MAP: @@ -277,15 +277,15 @@ def read_val(inbuf, ttype, spec=None, decode_response=True): return {} for i in range(sz): - k_val = read_val(inbuf, k_type, k_spec) - v_val = read_val(inbuf, v_type, v_spec) + k_val = read_val(inbuf, k_type, k_spec, decode_response) + v_val = read_val(inbuf, v_type, v_spec, decode_response) result[k_val] = v_val return result elif ttype == TType.STRUCT: obj = spec() - read_struct(inbuf, obj) + read_struct(inbuf, obj, decode_response) return obj diff --git a/thriftpy/protocol/cybin/cybin.pyx b/thriftpy/protocol/cybin/cybin.pyx index 8687ec7..84a574d 100644 --- a/thriftpy/protocol/cybin/cybin.pyx +++ b/thriftpy/protocol/cybin/cybin.pyx @@ -288,7 +288,8 @@ cdef c_read_val(CyTransportBase buf, TType ttype, spec=None, skip(buf, orig_type) return [] - return [c_read_val(buf, v_type, v_spec) for _ in range(size)] + return [c_read_val(buf, v_type, v_spec, decode_response) + for _ in range(size)] elif ttype == T_MAP: key = spec[0] @@ -317,11 +318,11 @@ cdef c_read_val(CyTransportBase buf, TType ttype, spec=None, skip(buf, orig_type) return {} - return {c_read_val(buf, k_type, k_spec): c_read_val(buf, v_type, v_spec) + return {c_read_val(buf, k_type, k_spec, decode_response): c_read_val(buf, v_type, v_spec, decode_response) for _ in range(size)} elif ttype == T_STRUCT: - return read_struct(buf, spec()) + return read_struct(buf, spec(), decode_response) cdef c_write_val(CyTransportBase buf, TType ttype, val, spec=None):