From bc15040c8e1737ed79eef482a5cd673598a7968d Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Wed, 1 Feb 2023 10:25:45 +0000 Subject: [PATCH] [FIX] core: ignore usage of html parser for ofx files The ofxparse module explicitly uses an html parser instead of xml but since bs4 4.11.0, this triggers a warning. closes odoo/odoo#113354 X-original-commit: e81ed97c9c54c69c68c54c69b4d3d80ed0515ae8 Signed-off-by: Christophe Monniez (moc) --- odoo/netsvc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/odoo/netsvc.py b/odoo/netsvc.py index 9a4db8f6bf2..776a6f49b6c 100644 --- a/odoo/netsvc.py +++ b/odoo/netsvc.py @@ -148,6 +148,13 @@ def init_logger(): warnings.filterwarnings('ignore', r'^Sampling from a set', category=DeprecationWarning, module='odoo') # https://github.com/urllib3/urllib3/issues/2680 warnings.filterwarnings('ignore', r'^\'urllib3.contrib.pyopenssl\' module is deprecated.+', category=DeprecationWarning) + # ofxparse use an html parser to parse ofx xml files and triggers a warning since bs4 4.11.0 + # https://github.com/jseutter/ofxparse/issues/170 + try: + from bs4 import XMLParsedAsHTMLWarning + warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning) + except ImportError: + pass # ignore a bunch of warnings we can't really fix ourselves for module in [ 'babel.util', # deprecated parser module, no release yet