π OpenHands: AI-Driven Development
Suppress pydub warning about ffmpeg/avconv not found (#8940)
Robert Brennan147ffb7e42e9
diff --git a/openhands/cli/main.py b/openhands/cli/main.pyindex b0e523f2fa..cf9c14e301 100644--- a/openhands/cli/main.py+++ b/openhands/cli/main.py@@ -8,6 +8,7 @@ from prompt_toolkit.formatted_text import HTMLfrom prompt_toolkit.shortcuts import clearimport openhands.agenthub # noqa F401 (we import this to get the agents registered)+import openhands.cli.suppress_warnings # noqa: F401from openhands.cli.commands import (check_folder_security_agreement,handle_commands,diff --git a/openhands/cli/suppress_warnings.py b/openhands/cli/suppress_warnings.pynew file mode 100644index 0000000000..3f61cd7186--- /dev/null+++ b/openhands/cli/suppress_warnings.py@@ -0,0 +1,10 @@+"""Module to suppress common warnings."""++import warnings++# Suppress pydub warning about ffmpeg/avconv+warnings.filterwarnings(+ 'ignore',+ message="Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work",+ category=RuntimeWarning,+)diff --git a/openhands/core/main.py b/openhands/core/main.pyindex df67e8746f..d6f0d67c0e 100644--- a/openhands/core/main.py+++ b/openhands/core/main.py@@ -5,6 +5,7 @@ from pathlib import Pathfrom typing import Callable, Protocolimport openhands.agenthub # noqa F401 (we import this to get the agents registered)+import openhands.cli.suppress_warnings # noqa: F401from openhands.controller.agent import Agentfrom openhands.controller.replay import ReplayManagerfrom openhands.controller.state.state import State