File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 0.43.1 - TBD
4+
5+ #### Bug fixes
6+ - Fixed an issue where validating the checksum of a batch file loaded the entire file into memory
7+
38## 0.43.0 - 2024-10-09
49
510This release drops support for Python 3.8 which has reached end-of-life.
Original file line number Diff line number Diff line change @@ -431,7 +431,11 @@ def _download_batch_file(
431431 hash_algo , _ , hash_hex = batch_download_file .hash_str .partition (":" )
432432
433433 if hash_algo == "sha256" :
434- output_hash = hashlib .sha256 (output_path .read_bytes ())
434+ output_hash = hashlib .new (hash_algo )
435+ with open (output_path , "rb" ) as fd :
436+ while chunk := fd .read (32_000_000 ):
437+ output_hash .update (chunk )
438+
435439 if output_hash .hexdigest () != hash_hex :
436440 warn_msg = f"Downloaded file failed checksum validation: { output_path .name } "
437441 logger .warning (warn_msg )
You can’t perform that action at this time.
0 commit comments