mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 10:45:27 +00:00
ensure chunk is either null or empty to exit loop
This commit is contained in:
parent
429b01b569
commit
72fee02ec4
1 changed files with 2 additions and 2 deletions
|
|
@ -645,7 +645,7 @@ def extract_compressed_file(file_path, output_path=None, delete_original=False):
|
|||
with open(extracted_path, 'wb') as out_file:
|
||||
while True:
|
||||
chunk = gz_file.read(MAX_EXTRACT_CHUNK_SIZE)
|
||||
if not chunk:
|
||||
if not chunk or len(chunk) == 0:
|
||||
break
|
||||
out_file.write(chunk)
|
||||
except Exception as e:
|
||||
|
|
@ -695,7 +695,7 @@ def extract_compressed_file(file_path, output_path=None, delete_original=False):
|
|||
with zip_file.open(xml_files[0], "r") as xml_file:
|
||||
while True:
|
||||
chunk = xml_file.read(MAX_EXTRACT_CHUNK_SIZE)
|
||||
if not chunk:
|
||||
if not chunk or len(chunk) == 0:
|
||||
break
|
||||
out_file.write(chunk)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue