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
commitdab592a23b93aa0c6eb04032656668ae76a5851f (patch)
tree7aef4e233b0ff4f16609781700359c2debd55798
parent72afdd59726791860f9cfb6c535ca021ab3efb19 (diff)
downloadbeautifulsoup4-dab592a23b93aa0c6eb04032656668ae76a5851f.tar.gz
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,