Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Support unicode characters in filenames and improve path handling, and fixed path validation failures in Windows OS environments.

lidongbo44d9c96cb53d
diff --git a/browser_use/filesystem/file_system.py b/browser_use/filesystem/file_system.py
index 58c537a18..7b210e693 100644
--- a/browser_use/filesystem/file_system.py
+++ b/browser_use/filesystem/file_system.py
@@ -229,8 +229,8 @@ class FileSystem:
# Build extensions pattern from _file_types
extensions = '|'.join(self._file_types.keys())
pattern = rf'^[a-zA-Z0-9_\-\u4e00-\u9fff]+\.({extensions})$'
- file_basename = os.path.basename(file_name)
- return bool(re.match(pattern, file_basename))
+ file_name_base = os.path.basename(file_name)
+ return bool(re.match(pattern, file_name_base))
def _parse_filename(self, filename: str) -> tuple[str, str]:
"""Parse filename into name and extension. Always check _is_valid_filename first."""