summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2021-12-21 15:53:21 -0500
committerLeonard Richardson <leonardr@segfault.org>2021-12-21 15:53:21 -0500
commit2906d69e91f12fc2cd632efb534636cc7847e860 (patch)
tree3f9a4680ea1e9a548e27ddfcd7e8895bd651c741 /bs4/__init__.py
parent4504e4fba31927ec3e5a5d9b3960ffd8efb2b798 (diff)
Standardized the wording of the MarkupResemblesLocatorWarning
warnings to to make them less judgemental about what you ought to be doing. [bug=1955450]
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py15
1 files changed, 8 insertions, 7 deletions
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
)