From a4efd87e50046d8de43debb3fcd5b0243fce88fd Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 2 Jun 2021 11:51:17 +0200 Subject: [PATCH] Use the full path when reading in EncryptedUpload Calling ``matrix_upload.py --encrypt`` with a filename outside of the current directory fails due to a typo in EncryptedUpload which uses the basename of the file instead of the original/full path. --- contrib/matrix_upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/matrix_upload.py b/contrib/matrix_upload.py index 25b79f5..64633f9 100755 --- a/contrib/matrix_upload.py +++ b/contrib/matrix_upload.py @@ -113,7 +113,7 @@ class EncryptedUpload(Upload): self.source_mimetype = self.mimetype self.mimetype = "application/octet-stream" - with open(self.filename, "rb") as file: + with open(self.file, "rb") as file: self.ciphertext, self.file_keys = encrypt_attachment(file.read()) def send_progress(self):