diff --git a/feed2toot/message.py b/feed2toot/message.py index ef431d6..909917e 100644 --- a/feed2toot/message.py +++ b/feed2toot/message.py @@ -18,6 +18,11 @@ # standard libraires imports import logging +# avoid BeautifulSoup warning output since v4.9.3 +# https://stackoverflow.com/questions/36039724/suppress-warning-of-url-in-beautifulsoup/78445796#78445796 +import warnings +from bs4 import MarkupResemblesLocatorWarning + # external liraries imports from bs4 import BeautifulSoup @@ -26,6 +31,10 @@ from feed2toot.addtags import AddTags from feed2toot.removeduplicates import RemoveDuplicates from feed2toot.tootpost import TootPost +# avoid BeautifulSoup warning output since v4.9.3 +# https://stackoverflow.com/questions/36039724/suppress-warning-of-url-in-beautifulsoup/78445796#78445796 +warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning) + def build_message(entrytosend, tweetformat, rss, tootmaxlen, notagsintoot): '''populate the rss dict with the new entry''' tweetwithnotag = tweetformat.format(**entrytosend)