Closed
Description
Describe the bug
We inadvertently passed the wrong data type into the encrypt_file
method. While the error was logged, it does not result in an exception that we can catch, which caused the task encrypting data to be marked as successful even though it had failed. The error message was:
[2025-05-21T18:59:50.163+0000] {gnupg.py:167} ERROR - Error sending data
Traceback (most recent call last):
File "/usr/local/airflow/.local/lib/python3.11/site-packages/gnupg.py", line 161, in _copy_data
outstream.write(data)
TypeError: a bytes-like object is required, not 'str'
This exception is not passed up the stack because it is swallowed at line 167.
To Reproduce
Steps to reproduce the behavior:
- Call
encrypt_file
with a string instead of a bytes-like object.
Expected behavior
The TypeError
should be thrown up the stack.
Screenshots
N/A
Environment
- OS: Linux
- Version of this library: 0.5.4
- Version of GnuPG: 2.3.7
Additional information
N/A
Metadata
Metadata
Assignees
Labels
No labels