From: Oleg Broytman Date: Tue, 25 Feb 2025 17:51:26 +0000 (+0300) Subject: Fix(bkmk_ph_beautifulsoup4): Ignore all XML-related warnings X-Git-Tag: 6.2.0~2 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=62de9ed65dcfe2be8068f23231d512749ffdafff;p=bookmarks_db.git Fix(bkmk_ph_beautifulsoup4): Ignore all XML-related warnings --- diff --git a/parse_html/bkmk_ph_beautifulsoup4.py b/parse_html/bkmk_ph_beautifulsoup4.py index 148a6f7..47c3130 100644 --- a/parse_html/bkmk_ph_beautifulsoup4.py +++ b/parse_html/bkmk_ph_beautifulsoup4.py @@ -5,7 +5,7 @@ This file is a part of Bookmarks database and Internet robot. """ __author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2017-2024 PhiloSoft Design" +__copyright__ = "Copyright (C) 2017-2025 PhiloSoft Design" __license__ = "GNU GPL" __all__ = ['parse_html'] @@ -14,14 +14,12 @@ __all__ = ['parse_html'] import warnings from bs4 import BeautifulSoup +from bs4 import XMLParsedAsHTMLWarning from .bkmk_ph_util import HTMLParser -warnings.filterwarnings( - 'ignore', 'No parser was explicitly specified') -warnings.filterwarnings( - 'ignore', - "It looks like you're parsing an XML document using an HTML parser.") +warnings.filterwarnings('ignore', 'No parser was explicitly specified') +warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning) universal_charset = "utf-8" DEFAULT_CHARSET = "cp1251" # Stupid default for Russian Cyrillic