Skip to content

Commit 5b9c372

Browse files
FIX: Resolve file existence check by converting Path to string in ./functions_committer.py
1 parent a421b2c commit 5b9c372

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Auto-Committer/functions_committer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,10 @@ def main():
503503

504504
start_time = datetime.datetime.now() # Get the start time of the program
505505

506-
if not verify_filepath_exists(FILE_PATH): # If the file does not exist
507-
print(f"{BackgroundColors.RED}Error: Target file {BackgroundColors.CYAN}{FILE_PATH}{BackgroundColors.RED} not found!{Style.RESET_ALL}") # Output error message
506+
file_path_str = str(FILE_PATH) # Convert FILE_PATH to string for logging
507+
508+
if not verify_filepath_exists(file_path_str): # If the target file does not exist, output an error message and exit
509+
print(f"{BackgroundColors.RED}Error: Target file {BackgroundColors.CYAN}{file_path_str}{BackgroundColors.RED} not found!{Style.RESET_ALL}") # Output error message
508510
return # Exit the function
509511

510512
original_text = FILE_PATH.read_text(encoding="utf-8") # Read the original file content

0 commit comments

Comments
 (0)