From 2d84111514d30ffb0c554ec7abe78e8fa4d68d1a Mon Sep 17 00:00:00 2001 From: Romain SOMMERARD Date: Thu, 6 Oct 2022 12:13:10 +0200 Subject: [PATCH] fix: 0B when not encrypted and compressed --- dbbackup/management/commands/dbrestore.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbbackup/management/commands/dbrestore.py b/dbbackup/management/commands/dbrestore.py index dd7ccdd8..a820c957 100644 --- a/dbbackup/management/commands/dbrestore.py +++ b/dbbackup/management/commands/dbrestore.py @@ -109,6 +109,9 @@ def _restore_backup(self): ) input_file.close() input_file = uncompressed_file + if not self.decrypt and not self.uncompress: + tmp_file = utils.create_spooled_temporary_file(fileobj=input_file) + input_file = tmp_file self.logger.info("Restore tempfile created: %s", utils.handle_size(input_file)) if self.interactive: