Describe the bug
I am using python 3.11 version in my aws lambda. Python-gnupg version i have used 0.5.2 but it is not working . i am facing issue like
FileNotFoundError: [Errno 2] No such file or directory: './gpg' . Even i was trying to add it as additional layer in lambda but it is not working as well .
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
without any fail , gnupg version might works for my python lambda
Screenshots
Environment
- OS, including version
- Version of this library
Additional information
Attached the cloudwatch aws log event for reference
Unable to run gpg (./gpg) - it may not be available.
--
| 2024-03-13T19:21:38.177+05:30 | Traceback (most recent call last):
| 2024-03-13T19:21:38.177+05:30 | File "/var/task/lambda_function.py", line 67, in lambda_handler
| 2024-03-13T19:21:38.177+05:30 | if validate_file(event_dictionary, downloaded_file_path, log):
| 2024-03-13T19:21:38.177+05:30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| 2024-03-13T19:21:38.177+05:30 | File "/opt/python/lib/python3.11/site-packages/gnupg.py", line 1094, in __init__
| 2024-03-13T19:21:38.177+05:30 | p = self._open_subprocess(['--list-config', '--with-colons'])
| 2024-03-13T19:21:38.177+05:30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| 2024-03-13T19:21:38.177+05:30 | File "/opt/python/lib/python3.11/site-packages/gnupg.py", line 1164, in _open_subprocess
| 2024-03-13T19:21:38.177+05:30 | result = Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE, startupinfo=si,
| 2024-03-13T19:21:38.177+05:30 | File "/var/lang/lib/python3.11/subprocess.py", line 1026, in __init__
| 2024-03-13T19:21:38.177+05:30 | self._execute_child(args, executable, preexec_fn, close_fds,
| 2024-03-13T19:21:38.177+05:30 | File "/var/lang/lib/python3.11/subprocess.py", line 1950, in _execute_child
| 2024-03-13T19:21:38.177+05:30 | raise child_exception_type(errno_num, err_msg, err_filename)
| 2024-03-13T19:21:38.177+05:30 | FileNotFoundError: [Errno 2] No such file or directory: './gpg'
| 2024-03-13T19:21:38.177+05:30 | [ERROR] OSError: Unable to run gpg (./gpg) - it may not be available. Traceback (most recent call last): File "/var/task/lambda_function.py", line 78, in lambda_handler move_error_file(event_dictionary, downloaded_file_path, log) File "/var/task/file_reader_helper.py", line 196, in encrypt_data_file gpg = gnupg.GPG(gnupghome=LAMBDA_TMP_PATH, gpgbinary='./gpg') File "/opt/python/lib/python3.11/site-packages/gnupg.py", line 1098, in __init__ raise OSError(msg)