我在用django-celery时尝试把httprequest作为参数调用task,结果保用一下错误,求解哪里粗错了?
add_scan_record.delay(request, card.id)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/celery/app/task.py", line 358, in delay
return self.apply_async(args, kwargs)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/celery/app/task.py", line 474, in apply_async
**options)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/celery/app/amqp.py", line 249, in publish_task
**kwargs
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/messaging.py", line 157, in publish
compression, headers)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/messaging.py", line 233, in _prepare
body) = encode(body, serializer=serializer)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/serialization.py", line 170, in encode
payload = encoder(data)
File "/Users/user/qrcardenv/lib/python2.7/site-packages/kombu/serialization.py", line 356, in dumps
return dumper(obj, protocol=pickle_protocol)
PicklingError: Can't pickle <type 'cStringIO.StringO'>: attribute lookup cStringIO.StringO failed