簡體   English   中英

無法使用Python27 SDK在Google Appengine上運行推送隊列任務

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM