summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuaki Sukegawa <nsuke@apache.org>2015-12-23 21:45:06 +0900
committerNobuaki Sukegawa <nsuke@apache.org>2016-01-02 22:54:16 +0900
commit7b8946941e5bcb1217711115fed3f6c77d73b5ef (patch)
tree081edb145dc156d63ccc0a4df959fa4d71588ffb /lib
parent6dde7f19254db71cf27df214a59d7156967237fc (diff)
downloadthrift-7b8946941e5bcb1217711115fed3f6c77d73b5ef.tar.gz
THRIFT-3504 Fix FastbinaryTest.py
Client: Python Patch: Nobuaki Sukegawa This closes #757
Diffstat (limited to 'lib')
-rw-r--r--lib/py/src/protocol/fastbinary.c5
-rw-r--r--lib/py/src/transport/TTransport.py7
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/py/src/protocol/fastbinary.c b/lib/py/src/protocol/fastbinary.c
index a17019b58..091a6170b 100644
--- a/lib/py/src/protocol/fastbinary.c
+++ b/lib/py/src/protocol/fastbinary.c
@@ -290,7 +290,7 @@ parse_struct_item_spec(StructItemSpec* dest, PyObject* spec_tuple) {
// i'd like to use ParseArgs here, but it seems to be a bottleneck.
if (PyTuple_Size(spec_tuple) != 5) {
- PyErr_Format(PyExc_TypeError, "expecting 5 arguments for spec tuple but got %d", PyTuple_Size(spec_tuple));
+ PyErr_Format(PyExc_TypeError, "expecting 5 arguments for spec tuple but got %d", (int)PyTuple_Size(spec_tuple));
return false;
}
@@ -350,7 +350,7 @@ static void writeDouble(PyObject* outbuf, double dub) {
/* --- MAIN RECURSIVE OUTPUT FUNCTION -- */
-static int
+static bool
output_val(PyObject* output, PyObject* value, TType type, PyObject* typeargs) {
/*
* Refcounting Strategy:
@@ -1185,7 +1185,6 @@ decode_val(DecodeBuffer* input, TType type, PyObject* typeargs) {
case T_STRUCT: {
StructTypeArgs parsedargs;
- PyObject* ret;
if (!parse_struct_args(&parsedargs, typeargs)) {
return NULL;
}
diff --git a/lib/py/src/transport/TTransport.py b/lib/py/src/transport/TTransport.py
index 3fe289a3f..92dc4cd78 100644
--- a/lib/py/src/transport/TTransport.py
+++ b/lib/py/src/transport/TTransport.py
@@ -139,7 +139,8 @@ class TBufferedTransport(TTransportBase, CReadableTransport):
def __init__(self, trans, rbuf_size=DEFAULT_BUFFER):
self.__trans = trans
self.__wbuf = BufferIO()
- self.__rbuf = BufferIO()
+ # Pass string argument to initialize read buffer as cStringIO.InputType
+ self.__rbuf = BufferIO(b'')
self.__rbuf_size = rbuf_size
def isOpen(self):
@@ -256,7 +257,7 @@ class TFramedTransport(TTransportBase, CReadableTransport):
def __init__(self, trans,):
self.__trans = trans
- self.__rbuf = BufferIO()
+ self.__rbuf = BufferIO(b'')
self.__wbuf = BufferIO()
def isOpen(self):
@@ -364,7 +365,7 @@ class TSaslClientTransport(TTransportBase, CReadableTransport):
self.sasl = SASLClient(host, service, mechanism, **sasl_kwargs)
self.__wbuf = BufferIO()
- self.__rbuf = BufferIO()
+ self.__rbuf = BufferIO(b'')
def open(self):
if not self.transport.isOpen():