nav*_*gil 4 python google-app-engine amazon-s3 boto amazon-web-services
我使用boto python库(在appengine中)几年,以便将文件上传到AWS S3.由于没有对代码进行任何新的更改,我在尝试更改S3上的文件时开始出现以下错误(在随机情况下).发生错误后,文件不会更新.
我的代码是:
if website_bucket is not None:
new_key = Key(website_bucket)
new_key.key = "live/"+page_domain+"/"+s3_name
new_key.set_metadata('original_filename', s3_name)
if s3_name == "sitemap.xml":
new_key.set_metadata('Content-Type', 'text/xml')
else:
new_key.set_metadata('Content-Type', 'text/html')
new_key.set_contents_from_string(page_html, policy='public-read')
return s3_name
Run Code Online (Sandbox Code Playgroud)
错误是:
in file /boto/s3/key.py", line 684, in sender
S3ResponseError: S3ResponseError: 100 Continue
Run Code Online (Sandbox Code Playgroud)
我不知道boto库的版本......
它又发生了......
boto版本是2.5.2
修复是评论该行:
headers['Expect'] = '100-Continue'
Run Code Online (Sandbox Code Playgroud)
在boto key.py文件中
来源:https : //www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fsminteractive%2Fboto%2Fcommit%2F59b0d6645db736138d87cf47a4c9e49d2a49e01e&sa=D&sntz=1&usg=AFQjCNEJb1UtdqOlhjmQ-NthWZplGOB7oA
| 归档时间: |
|
| 查看次数: |
313 次 |
| 最近记录: |