Python gearman Received non-binary argument

253 views Asked by At

i got a error in gearman. Try anything like , only send a string letter or number or string number but always got this error pls help... (same code working other view)

Request Method: POST
Request URL:    http://local.example.com:8000/business/user-panel
Django Version: 1.6.6
Exception Type: ProtocolError
Exception Value:    
Received non-binary arguments: {'unique': 'ab69c55005d118f92e27dcaa3a9bb5d7', 'task': u'task_name', 'data': "1010"}
Exception Location: /home/xcoder/NopyFlexiEnv/lib/python2.7/site-packages/gearman/protocol.py in pack_binary_command, line 242
Python Executable:  /home/xcoder/NopyFlexiEnv/bin/python2.7
Python Version: 2.7.6
1

There are 1 answers

0
mozillazg On BEST ANSWER

After read source code, I found that the gearman client doesn't support unicode.
Change argument's type to str or bytes will fix your issue.

client.submit_job("task1")   # error: Received non-binary arguments
client.submit_job(b"task1")  # ok