From dbae5896231a697cdabfe3f2b9310a5b2be6d3ba Mon Sep 17 00:00:00 2001 From: "mingzhong.li" Date: Sun, 22 Jun 2025 17:52:14 +0800 Subject: [PATCH] fix: fixing open file encoding error in windows --- browser_use/agent/prompts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser_use/agent/prompts.py b/browser_use/agent/prompts.py index 868e3eb1f..9f78f63b1 100644 --- a/browser_use/agent/prompts.py +++ b/browser_use/agent/prompts.py @@ -36,7 +36,7 @@ class SystemPrompt: """Load the prompt template from the markdown file.""" try: # This works both in development and when installed as a package - with importlib.resources.files('browser_use.agent').joinpath('system_prompt.md').open('r') as f: + with importlib.resources.files('browser_use.agent').joinpath('system_prompt.md').open('r', encoding='utf-8') as f: self.prompt_template = f.read() except Exception as e: raise RuntimeError(f'Failed to load system prompt template: {e}')