backup: one more py3k related fix

This commit is contained in:
Marek Marczykowski-Górecki 2017-02-23 00:11:51 +01:00
parent e52d8fb051
commit 2c3e112951
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1652,7 +1652,7 @@ class BackupRestore(object):
"failed). Is the password correct?") "failed). Is the password correct?")
if os.path.basename(filename) == HEADER_FILENAME: if os.path.basename(filename) == HEADER_FILENAME:
filename = os.path.join(self.tmpdir, filename) filename = os.path.join(self.tmpdir, filename)
header_data = BackupHeader(open(filename, 'r').read()) header_data = BackupHeader(open(filename, 'rb').read())
os.unlink(filename) os.unlink(filename)
else: else:
# if no header found, create one with guessed HMAC algo # if no header found, create one with guessed HMAC algo