Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Apply filesystem UTF-8 style fixes
Ghraven7d79ac95da70
diff --git a/browser_use/filesystem/file_system.py b/browser_use/filesystem/file_system.pyindex f7cb2b435..103b4b7da 100644--- a/browser_use/filesystem/file_system.py+++ b/browser_use/filesystem/file_system.py@@ -115,9 +115,7 @@ class BaseFile(BaseModel, ABC):async def sync_to_disk(self, path: Path) -> None:file_path = path / self.full_namewith ThreadPoolExecutor() as executor:- await asyncio.get_event_loop().run_in_executor(- executor, lambda: file_path.write_text(self.content, encoding='utf-8')- )+ await asyncio.get_event_loop().run_in_executor(executor, lambda: file_path.write_text(self.content, encoding='utf-8'))async def write(self, content: str, path: Path) -> None:self.write_file_content(content)diff --git a/tests/ci/infrastructure/test_filesystem.py b/tests/ci/infrastructure/test_filesystem.pyindex 3e7da4efe..273be8a0d 100644--- a/tests/ci/infrastructure/test_filesystem.py+++ b/tests/ci/infrastructure/test_filesystem.py@@ -115,7 +115,7 @@ class TestBaseFile:file_path = tmp_path / 'test.md'assert file_path.exists()assert file_path.read_text(encoding='utf-8') == '# Test Content\nJosé'- assert file_path.read_bytes().endswith('José'.encode('utf-8'))+ assert file_path.read_bytes().endswith('José'.encode())# Test write operationawait file_obj.write('# New Content', tmp_path)