From 640b06b09707beb30940569665ad6a3979d69b97 Mon Sep 17 00:00:00 2001 From: loonghao Date: Thu, 16 May 2024 11:02:39 +0800 Subject: [PATCH] fix: fix decode bytes for `scan_files_from_file` Signed-off-by: loonghao --- maya_umbrella/filesystem.py | 2 +- maya_umbrella/scanner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maya_umbrella/filesystem.py b/maya_umbrella/filesystem.py index 0e8b776..d1f5c52 100644 --- a/maya_umbrella/filesystem.py +++ b/maya_umbrella/filesystem.py @@ -45,7 +45,7 @@ def read_file(path): path (str): File path of source. Returns: - str: The contents of the file path. + bytes: The contents of the file path. """ with open(path, "rb") as file_stream: diff --git a/maya_umbrella/scanner.py b/maya_umbrella/scanner.py index b87eb80..40c08d8 100644 --- a/maya_umbrella/scanner.py +++ b/maya_umbrella/scanner.py @@ -84,7 +84,7 @@ def scan_files_from_file(self, text_file): Args: text_file (str): Path to the text file containing the list of file paths. """ - file_data = read_file(text_file) + file_data = read_file(text_file).decode() files = file_data.splitlines() return self.scan_files_from_list(files)