Error also occurs when the rename string is too long

This commit is contained in:
admin 2024-05-26 23:53:58 -04:00
parent af09a46f05
commit 4824f6e136

View File

@ -14,7 +14,7 @@ def append_to_folder_name(folder_path, suffix):
os.rename(folder_path, os.path.join(os.path.dirname(folder_path), new_folder_name))
print(f"Folder renamed to: {new_folder_name}")
except FileNotFoundError:
print(f"Error: Folder '{folder_path}' not found.")
print(f"Error: Unable to rename folder '{folder_path}'.")
os.system("pause")
def get_subdirectories(folder_path):