I am creating a AWS lambda to encrypt / decrypt files in s3 using python-gnupg, but when running serverless lambda this error (unsafe permissions on homedir `/tmp/sls-py-req/gnupg') is displayed when running the command gpg.gnupg.GPG(gnupghome=homedir)
homedir='/tmp'
try:
gpg = gnupg.GPG(gnupghome=homedir)
except TypeError:
gpg = gnupg.GPG(homedir=homedir)
Running lambda locally on my machine, the error does not occur.