summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-04-03 10:10:13 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2012-04-03 10:10:13 -0400
commitaefa224ccafc202b91775329cbb5f478af9a1288 (patch)
tree20e6861ed80649fef712568b057c6ce34e64f42f
parent6a02ce5d6ae8286736d74ce0b616810fa234cbc2 (diff)
Got rid of the 4.0.2 workaround for HTML documents--it was unnecessary and the workaround was triggering a (possibly different, but related) bug in lxml. [bug=972466]
-rw-r--r--NEWS.txt4
-rw-r--r--bs4/builder/_lxml.py3
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 6ee67b4..f000d3d 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -3,6 +3,10 @@
* Fixed a typo that caused some versions of Python 3 to convert the
Beautiful Soup codebase incorrectly.
+* Got rid of the 4.0.2 workaround for HTML documents--it was
+ unnecessary and the workaround was triggering a (possibly different,
+ but related) bug in lxml. [bug=972466]
+
= 4.0.2 (20120326) =
* Worked around a possible bug in lxml that prevents non-tiny XML
diff --git a/bs4/builder/_lxml.py b/bs4/builder/_lxml.py
index 5c7b058..6491322 100644
--- a/bs4/builder/_lxml.py
+++ b/bs4/builder/_lxml.py
@@ -80,7 +80,8 @@ class LXMLTreeBuilderForXML(TreeBuilder):
while data != '':
# Now call feed() on the rest of the data, chunk by chunk.
data = markup.read(self.CHUNK_SIZE)
- self.parser.feed(data)
+ if data != '':
+ self.parser.feed(data)
self.parser.close()
def close(self):