From d7c2532137023e4674701382f511622ccc28ef08 Mon Sep 17 00:00:00 2001 From: Chesars Date: Wed, 11 Mar 2026 13:37:52 -0300 Subject: [PATCH] fix: remove redundant import os, use Path().name instead --- litellm/litellm_core_utils/prompt_templates/common_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/prompt_templates/common_utils.py b/litellm/litellm_core_utils/prompt_templates/common_utils.py index 12447b39e1e..3e639e79b6d 100644 --- a/litellm/litellm_core_utils/prompt_templates/common_utils.py +++ b/litellm/litellm_core_utils/prompt_templates/common_utils.py @@ -5,7 +5,6 @@ Common utility functions used for translating messages across providers import io import mimetypes import re -import os from os import PathLike from pathlib import Path from typing import ( @@ -647,7 +646,7 @@ def extract_file_data(file_data: FileTypes) -> ExtractedFileData: # If it's a file-like object # Try to get filename from file handle if not already set if not filename and hasattr(file_content, 'name'): - filename = os.path.basename(file_content.name) + filename = Path(file_content.name).name content = file_content.read()