Skip to content

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

style: fix linter issues from CI

Magnus Müller5e25d92befbc
diff --git a/browser_use/filesystem/file_system.py b/browser_use/filesystem/file_system.py
index 25a8f939a..d3c40bd35 100644
--- a/browser_use/filesystem/file_system.py
+++ b/browser_use/filesystem/file_system.py
@@ -48,29 +48,31 @@ def _build_filename_error_message(file_name: str, supported_extensions: list[str
if ext_lower in UNSUPPORTED_BINARY_EXTENSIONS:
return (
f"Error: Cannot write binary/image file '{base}'. "
- f"The write_file tool only supports text-based files. "
- f"Supported extensions: {', '.join('.' + e for e in supported_extensions)}. "
- f"For screenshots, the browser automatically captures them - do not try to save screenshots as files."
+ f'The write_file tool only supports text-based files. '
+ f'Supported extensions: {", ".join("." + e for e in supported_extensions)}. '
+ f'For screenshots, the browser automatically captures them - do not try to save screenshots as files.'
)
if ext_lower not in supported_extensions:
return (
f"Error: Unsupported file extension '.{ext_lower}' in '{base}'. "
- f"Supported extensions: {', '.join('.' + e for e in supported_extensions)}. "
- f"Please rename the file to use a supported extension."
+ f'Supported extensions: {", ".join("." + e for e in supported_extensions)}. '
+ f'Please rename the file to use a supported extension.'
)
# No extension or no dot
if '.' not in base:
return (
f"Error: Filename '{base}' has no extension. "
- f"Please add a supported extension: {', '.join('.' + e for e in supported_extensions)}."
+ f'Please add a supported extension: {", ".join("." + e for e in supported_extensions)}.'
)
return (
f"Error: Invalid filename '{base}'. "
- f"Filenames must contain only letters, numbers, underscores, hyphens, dots, parentheses, and spaces. "
- f"Supported extensions: {', '.join('.' + e for e in supported_extensions)}."
+ f'Filenames must contain only letters, numbers, underscores, hyphens, dots, parentheses, and spaces. '
+ f'Supported extensions: {", ".join("." + e for e in supported_extensions)}.'
)
+
+
DEFAULT_FILE_SYSTEM_PATH = 'browseruse_agent_data'
diff --git a/tests/ci/infrastructure/test_filesystem.py b/tests/ci/infrastructure/test_filesystem.py
index e6cd20104..5a62b764f 100644
--- a/tests/ci/infrastructure/test_filesystem.py
+++ b/tests/ci/infrastructure/test_filesystem.py
@@ -17,7 +17,6 @@ from browser_use.filesystem.file_system import (
JsonlFile,
MarkdownFile,
TxtFile,
- XmlFile,
)