OSError while using convert_from_bytes
Hi,
I am using pdf2image in my application hosted on aws lambda (env python3.6). While I am using convert_from_bytes in my application, it is failing when saving the converted file although file bytes are being loaded into lambda memory.
The stack trace received in logs -
[Errno 14] Bad address: OSError Traceback (most recent call last): File "/opt/python/pdf2image/pdf2image.py", line 158, in convert_from_bytes File "/opt/python/pdf2image/pdf2image.py", line 112, in convert_from_path File "/var/lang/lib/python3.6/subprocess.py", line 863, in communicate File "/var/lang/lib/python3.6/subprocess.py", line 1554, in _communicate data = os.read(key.fd, 32768) OSError: [Errno 14] Bad address
Is there any way to handle such errors ? Any limits? Increasing lambda memory will always be a temporary solution for this problem.
Thanks!
My guess would be that it is running out of memory, but you shouldn't be using convert_from_bytes without an output_folder in a memory constrained environment like lambda anyway. See my other repo as an example.