[英]Unable to run a push queue task on Google Appengine with the Python27 SDK
尝试在Google Appengine Python27 SDK(在Python 2.5上运行良好)上启动简单的推送队列任务时,我得到的回溯结尾为:
File "c:\program files\google\google_appengine\google\appengine\api\taskqueue\
taskqueue_stub.py", line 1662, in ExecuteTask connection.putheader(header_key, header_value)
File "C:\Python27\lib\httplib.py", line 924, in putheader str = '%s: %s' % (header, '\r\n\t'.join(values))
TypeError: sequence item 0: expected string, int found
上面的TypeError发生于
header = 'Content-Length'
values = (112,)
那显然应该是values =('112',)
感谢您的任何建议,
莫特
看起来像个错误,已经报告它: 问题6460:开发服务器-任务队列存根类型错误
要使其正常工作,您需要手动修补SDK,文件为: google / appengine / api /taskqueue/taskqueue_stub.py ,如下所示:
headers.append(('Content-Length', len(task.body())))
修正为:
headers.append(('Content-Length', str(len(task.body()))))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.