From aca240bb31647daee18a1fec17e3debd257ebe99 Mon Sep 17 00:00:00 2001 From: Arun Prabhakar Date: Sat, 1 Sep 2018 12:56:43 +0530 Subject: [PATCH] Copy stat of the files into the zip files Copy the permissions and stats to the zip files so that executable binary files remain executable. --- aws_lambda/aws_lambda.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws_lambda/aws_lambda.py b/aws_lambda/aws_lambda.py index 17c0126..43054cd 100755 --- a/aws_lambda/aws_lambda.py +++ b/aws_lambda/aws_lambda.py @@ -11,6 +11,7 @@ from imp import load_source from shutil import copy from shutil import copyfile +from shutil import copystat from shutil import copytree from tempfile import mkdtemp @@ -346,6 +347,7 @@ def build( # Copy handler file into root of the packages folder. copyfile(f, os.path.join(path_to_temp, filename)) + copystat(f, os.path.join(path_to_temp, filename)) elif os.path.isdir(f): destination_folder = os.path.join(path_to_temp, f[len(src) + 1:]) copytree(f, destination_folder)