Fix issue with backup compression

This commit is contained in:
amcmanu3 2024-05-25 15:11:58 -04:00
parent c037f1d1af
commit 41147266ad

View File

@ -4,7 +4,7 @@ import logging
import pathlib import pathlib
import tempfile import tempfile
import zipfile import zipfile
from zipfile import ZipFile, ZIP_DEFLATED from zipfile import ZipFile, ZIP_DEFLATED, ZIP_STORED
import urllib.request import urllib.request
import ssl import ssl
import time import time
@ -254,7 +254,7 @@ class FileHelpers:
results, results,
) )
# Set the compression mode based on the `compressed` parameter # Set the compression mode based on the `compressed` parameter
compression_mode = ZIP_DEFLATED if compressed else None compression_mode = ZIP_DEFLATED if compressed else ZIP_STORED
with ZipFile(path_to_destination, "w", compression_mode) as zip_file: with ZipFile(path_to_destination, "w", compression_mode) as zip_file:
zip_file.comment = bytes( zip_file.comment = bytes(
comment, "utf-8" comment, "utf-8"