From 58128a574aabb12f5b1eb24a913596b25c0a051a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 25 Sep 2014 00:35:44 +0200 Subject: [PATCH] backups: force ASCII when writing backup header --- core/backup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/backup.py b/core/backup.py index 0a634430..b5055244 100644 --- a/core/backup.py +++ b/core/backup.py @@ -391,10 +391,11 @@ def prepare_backup_header(target_directory, passphrase, compressed=False, crypto_algorithm=DEFAULT_CRYPTO_ALGORITHM): header_file_path = os.path.join(target_directory, HEADER_FILENAME) with open(header_file_path, "w") as f: - f.write("%s=%s\n" % (BackupHeader.hmac_algorithm, hmac_algorithm)) - f.write("%s=%s\n" % (BackupHeader.crypto_algorithm, crypto_algorithm)) - f.write("%s=%s\n" % (BackupHeader.encrypted, str(encrypted))) - f.write("%s=%s\n" % (BackupHeader.compressed, str(compressed))) + f.write(str("%s=%s\n" % (BackupHeader.hmac_algorithm, hmac_algorithm))) + f.write(str("%s=%s\n" % (BackupHeader.crypto_algorithm, + crypto_algorithm))) + f.write(str("%s=%s\n" % (BackupHeader.encrypted, str(encrypted)))) + f.write(str("%s=%s\n" % (BackupHeader.compressed, str(compressed)))) hmac = subprocess.Popen (["openssl", "dgst", "-" + hmac_algorithm, "-hmac", passphrase],