From 147ffb7e42e90693111b30caee47b0df4701a7cd Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Tue, 17 Jun 2025 14:44:32 -0400 Subject: [PATCH] Suppress pydub warning about ffmpeg/avconv not found (#8940) Co-authored-by: openhands --- openhands/cli/main.py | 1 + openhands/cli/suppress_warnings.py | 10 ++++++++++ openhands/core/main.py | 1 + 3 files changed, 12 insertions(+) create mode 100644 openhands/cli/suppress_warnings.py diff --git a/openhands/cli/main.py b/openhands/cli/main.py index b0e523f2fa..cf9c14e301 100644 --- a/openhands/cli/main.py +++ b/openhands/cli/main.py @@ -8,6 +8,7 @@ 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 new file mode 100644 index 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.py index df67e8746f..d6f0d67c0e 100644 --- a/openhands/core/main.py +++ b/openhands/core/main.py @@ -5,6 +5,7 @@ from pathlib import Path from typing import Callable, Protocol import openhands.agenthub # noqa F401 (we import this to get the agents registered) +import openhands.cli.suppress_warnings # noqa: F401 from openhands.controller.agent import Agent from openhands.controller.replay import ReplayManager from openhands.controller.state.state import State