summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2016-07-16 18:52:05 -0400
committerLeonard Richardson <leonardr@segfault.org>2016-07-16 18:52:05 -0400
commit120f4fcedc825b6c207263858e5bbded60a7886e (patch)
tree3b6a4ad03695bb323ca52dbc1393c054c8936f02
parent5892a329d4799adf9c5fe4b2ec36e565359efbb3 (diff)
We don't run the check for a filename passed in as markup if the
'filename' contains a less-than character; the less-than character indicates it's most likely a very small document. [bug=1577864]
-rw-r--r--NEWS.txt4
-rw-r--r--bs4/__init__.py2
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS.txt b/NEWS.txt
index d81e3f2..76dedd6 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -13,6 +13,10 @@
were markup. Thanks to James Salter for a patch and
test. [bug=1533762]
+* We don't run the check for a filename passed in as markup if the
+ 'filename' contains a less-than character; the less-than character
+ indicates it's most likely a very small document. [bug=1577864]
+
= 4.4.1 (20150928) =
* Fixed a bug that deranged the tree when part of it was
diff --git a/bs4/__init__.py b/bs4/__init__.py
index da9196d..4df3280 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -184,7 +184,7 @@ class BeautifulSoup(Tag):
if hasattr(markup, 'read'): # It's a file-type object.
markup = markup.read()
- elif len(markup) <= 256:
+ elif len(markup) <= 256 and not '<' in markup:
# Print out warnings for a couple beginner problems
# involving passing non-markup to Beautiful Soup.
# Beautiful Soup will still parse the input as markup,