summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,