python - 使用thriftpy库报错
大家讲道理
大家讲道理 2017-04-18 09:26:18
0
0
1192

最近在做公司的微信企业的功能开发,用微信来发送报警,并做成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)

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板