summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG4
-rw-r--r--bs4/__init__.py15
2 files changed, 12 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a4fe1fc..412287e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -49,6 +49,10 @@ Python 2 was revision 605.
* Fixed a crash when overriding multi_valued_attributes and using the
html5lib parser. [bug=1948488]
+* Changed the wording of the MarkupResemblesLocatorWarning
+ warnings to to make them less judgemental about what you ought to
+ be doing. [bug=1955450]
+
* Removed support for the iconv_codec library, which doesn't seem
to exist anymore and was never put up on PyPI. (The closest
replacement on PyPI, iconv_codecs, is GPL-licensed, so we can't use
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 75c801c..2371ccf 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -346,8 +346,8 @@ class BeautifulSoup(Tag):
)
elif is_file:
warnings.warn(
- '"%s" looks like a filename, not markup. You should'
- ' probably open this file and pass the filehandle into'
+ '"%s" looks like a filename, not markup. You may'
+ ' want to open this file and pass the filehandle into'
' Beautiful Soup.' % self._decode_markup(markup),
MarkupResemblesLocatorWarning
)
@@ -432,11 +432,12 @@ class BeautifulSoup(Tag):
if any(markup.startswith(prefix) for prefix in cant_start_with):
if not space in markup:
warnings.warn(
- '"%s" looks like a URL. Beautiful Soup is not an'
- ' HTTP client. You should probably use an HTTP client like'
- ' requests to get the document behind the URL, and feed'
- ' that document to Beautiful Soup.' % cls._decode_markup(
- markup
+ '"%s" looks like a URL, not markup. You may want to use'
+ ' an HTTP client like requests to get the document behind'
+ ' the URL, and feed that document to Beautiful Soup.' % (
+ cls._decode_markup(
+ markup
+ )
),
MarkupResemblesLocatorWarning
)