S3ResponseError: 100 Continue - python (appengine)

I have been using the boto python library (in appengine) for several years to upload files to AWS S3. With no new changes to the code, I started getting the following error (in random cases) when trying to change files to S3. After an error occurs, the files are not updated.

My code is:

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

Error:

in file /boto/s3/key.py", line 684, in sender
S3ResponseError: S3ResponseError: 100 Continue

I do not know the version of the boto library ...

+4
source share
1 answer

It happened again ...

Boto version - 2.5.2

The fix is ​​to comment out the line:

headers['Expect'] = '100-Continue'

in boto key.py file

: https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fsminteractive%2Fboto%2Fcommit%2F59b0d6645db736138d87cf47a4c9e49d2a49e01e&sa=D&sntz=1&usg=AFQjCNEJb1UtdqOlhjmQ-NthWZplGOB7oA

+5

Source: https://habr.com/ru/post/1568134/


All Articles