Strip trailing whitespace before encrypting entries

Former-commit-id: 32429dfb574e465486d1397445fa8b34f5dd73fb
Former-commit-id: aca5cc58197564a74e99345ed08c3363dd5acea0
This commit is contained in:
2023-06-20 09:55:40 -04:00
parent 7dedfcac17
commit d417ff48ba
+1 -1
View File
@@ -133,7 +133,7 @@ def edit_note(_note_lines, _exit_on_match=False):
# encrypts an entry and cleans up the temporary files
def encrypt(_entry_data, _entry_dir, _gpg_id):
_bytes_data = '\n'.join(_entry_data).encode()
_bytes_data = '\n'.join(_entry_data).rstrip().encode()
_encrypted_data = run(('gpg', '-qr', str(_gpg_id), '-e'), input=_bytes_data, stdout=PIPE).stdout
open(_entry_dir + '.gpg', 'wb').write(_encrypted_data)