Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fixes bug 9682 (#9692)

Neeraj Panwardf86fd275d03
diff --git a/openhands/cli/main.py b/openhands/cli/main.py
index 8ba3f3927c..ac9898c9cf 100644
--- a/openhands/cli/main.py
+++ b/openhands/cli/main.py
@@ -1,3 +1,5 @@
+import openhands.cli.suppress_warnings # noqa: F401 # isort: skip
+
import asyncio
import logging
import os
@@ -8,7 +10,6 @@ from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.shortcuts import clear
import openhands.agenthub # noqa F401 (we import this to get the agents registered)
-import openhands.cli.suppress_warnings # noqa: F401
from openhands.cli.commands import (
check_folder_security_agreement,
handle_commands,
diff --git a/openhands/cli/suppress_warnings.py b/openhands/cli/suppress_warnings.py
index 01042cc443..1cc430a998 100644
--- a/openhands/cli/suppress_warnings.py
+++ b/openhands/cli/suppress_warnings.py
@@ -41,6 +41,12 @@ def suppress_cli_warnings():
category=UserWarning,
)
+ # Suppress SyntaxWarnings from pydub.utils about invalid escape sequences
+ warnings.filterwarnings(
+ 'ignore',
+ category=SyntaxWarning,
+ module=r'pydub\.utils',
+ )
# Suppress LiteLLM close_litellm_async_clients was never awaited warning
warnings.filterwarnings(
'ignore',
diff --git a/openhands/server/__main__.py b/openhands/server/__main__.py
index b2f621014b..2f57570992 100644
--- a/openhands/server/__main__.py
+++ b/openhands/server/__main__.py
@@ -1,9 +1,13 @@
import os
+import warnings
import uvicorn
def main():
+ # Suppress SyntaxWarnings from pydub.utils about invalid escape sequences
+ warnings.filterwarnings('ignore', category=SyntaxWarning, module=r'pydub\.utils')
+
uvicorn.run(
'openhands.server.listen:app',
host='0.0.0.0',