首页 > 使用thriftpy库报错

使用thriftpy库报错

最近在做公司的微信企业的功能开发,用微信来发送报警,并做成thrift服务,使用了饿了么开源的thriftpy库,当发送内容中包含中文的时候就报错,不知道为啥

 client.sendwx("wangbaoqiang", "你好")

Traceback (most recent call last):
File "client.py", line 15, in <module>

client.sendwx("wangbaoqiang", "你好")

File "/home/rocky/pyenv/lib/python2.7/site-packages/thriftpy/thrift.py", line 160, in _req

return self._recv(_api)

File "/home/rocky/pyenv/lib/python2.7/site-packages/thriftpy/thrift.py", line 172, in _recv

fname, mtype, rseqid = self._iprot.read_message_begin()

File "thriftpy/protocol/cybin/cybin.pyx", line 429, in cybin.TCyBinaryProtocol.read_message_begin (thriftpy/protocol/cybin/cybin.c:6312)
File "thriftpy/protocol/cybin/cybin.pyx", line 60, in cybin.read_i32 (thriftpy/protocol/cybin/cybin.c:1531)
File "thriftpy/transport/buffered/cybuffered.pyx", line 65, in thriftpy.transport.buffered.cybuffered.TCyBufferedTransport.c_read (thriftpy/transport/buffered/cybuffered.c:1872)
File "thriftpy/transport/buffered/cybuffered.pyx", line 69, in thriftpy.transport.buffered.cybuffered.TCyBufferedTransport.read_trans (thriftpy/transport/buffered/cybuffered.c:1939)
File "thriftpy/transport/cybase.pyx", line 61, in thriftpy.transport.cybase.TCyBuffer.read_trans (thriftpy/transport/cybase.c:1463)
File "/home/rocky/pyenv/lib/python2.7/site-packages/thriftpy/transport/socket.py", line 125, in read
message='TSocket read 0 bytes')
thriftpy.transport.TTransportException: TTransportException(message='TSocket read 0 bytes', type=4)

【热门文章】
【热门文章】