From 0af63228b5541b143c69c8e71f8212adc2e90dab Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Wed, 25 Jan 2023 14:48:06 +0200 Subject: [PATCH] fix read file --- find_duplicate_files/find_duplicate_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find_duplicate_files/find_duplicate_files.py b/find_duplicate_files/find_duplicate_files.py index 3020a12..e6c4380 100644 --- a/find_duplicate_files/find_duplicate_files.py +++ b/find_duplicate_files/find_duplicate_files.py @@ -46,8 +46,8 @@ class find_duplicate_files: if not file.name.startswith('.'): if file.is_file(): hash = hashlib.sha256() - with open(file.path, 'r') as file_pointer: - digest = hashlib.file_digest(f, "sha256") + with open(file.path, 'rb') as file_pointer: + digest = hashlib.file_digest(file_pointer, "sha256") files[digest.hexdigest()] = file.path elif file.is_dir(follow_symlinks=False): more_files = self.recursive_scandir(