when I have a model.xlsx
with an image and this code is working perfectly on windows. (keeping the image in output.xlsx
)
import openpyxl
wb = openpyxl.load_workbook('model.xlsx')
#doing some stuff on the wb
wb.save('output.xlsx')
Now when I do this on my AWS Lambda everything works perfectly BUT I don't have the image on the output.xlsx
.
No error message raised.
import json
import openpyxl
from tempfile import NamedTemporaryFile
import boto3
import botocore
def lambda_handler(event, context):
s3_client = boto3.client('s3', aws_access_key_id='*****', aws_secret_access_key='*****')
wb = openpyxl.load_workbook('model.xlsx')
#doing some stuff on the wb
with NamedTemporaryFile() as tmp:
wb.save(tmp.name)
tmp.seek(0)
s3_client.upload_file(tmp.name, "my-bucket-name", "filename-in-the-bucket")
return {
'statusCode': 200,
'body': json.dumps("Hello World")
}
Should I raise a ticket to AWS ? openpyxl ? Why is there no error message ?