diff options
author | Leonard Richardson <leonardr@segfault.org> | 2016-07-16 18:52:05 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2016-07-16 18:52:05 -0400 |
commit | 120f4fcedc825b6c207263858e5bbded60a7886e (patch) | |
tree | 3b6a4ad03695bb323ca52dbc1393c054c8936f02 | |
parent | 5892a329d4799adf9c5fe4b2ec36e565359efbb3 (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.txt | 4 | ||||
-rw-r--r-- | bs4/__init__.py | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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, |