Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /snowcell-cloud_Snowcode /openhands /cli /suppress_warnings.py
| """Module to suppress common warnings in CLI mode.""" | |
| import warnings | |
| def suppress_cli_warnings(): | |
| """Suppress common warnings that appear during CLI usage.""" | |
| # 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, | |
| ) | |
| # Suppress Pydantic serialization warnings | |
| warnings.filterwarnings( | |
| 'ignore', | |
| message='.*Pydantic serializer warnings.*', | |
| category=UserWarning, | |
| ) | |
| # Suppress specific Pydantic serialization unexpected value warnings | |
| warnings.filterwarnings( | |
| 'ignore', | |
| message='.*PydanticSerializationUnexpectedValue.*', | |
| category=UserWarning, | |
| ) | |
| # Suppress general deprecation warnings from dependencies during CLI usage | |
| # This catches the "Call to deprecated method get_events" warning | |
| warnings.filterwarnings( | |
| 'ignore', | |
| message='.*Call to deprecated method.*', | |
| category=DeprecationWarning, | |
| ) | |
| # Suppress other common dependency warnings that don't affect functionality | |
| warnings.filterwarnings( | |
| 'ignore', | |
| message='.*Expected .* fields but got .*', | |
| 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', | |
| message="coroutine 'close_litellm_async_clients' was never awaited", | |
| category=RuntimeWarning, | |
| ) | |
| # Apply warning suppressions when module is imported | |
| suppress_cli_warnings() | |
Xet Storage Details
- Size:
- 1.81 kB
- Xet hash:
- 885315dde578905cd81d220580d5cb7596e0b7e74377f7509cf59841e69f7beb
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.