summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-20 09:40:13 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-20 09:40:13 -0400
commit9f370bad91d80570a57156f53c6a9efc918ff90f (patch)
tree0484f795e984ef8a19cb88c772fee1d2f30f94ef
parentdae9722244850754533647c77f418f626ba05124 (diff)
html5lib now supports Python 3. Fixed some Python 2-specific
code in the html5lib test suite. [bug=1181624]
-rw-r--r--NEWS.txt7
-rw-r--r--bs4/tests/test_html5lib.py2
-rw-r--r--doc/source/index.rst10
3 files changed, 13 insertions, 6 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 862513a..2c8541c 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,10 @@
+= 4.2.1 (Unreleased) =
+
+* Fixed test failures when lxml is not installed. [bug=1181589]
+
+* html5lib now supports Python 3. Fixed some Python 2-specific
+ code in the html5lib test suite. [bug=1181624]
+
= 4.2.0 (20130514) =
* The Tag.select() method now supports a much wider variety of CSS
diff --git a/bs4/tests/test_html5lib.py b/bs4/tests/test_html5lib.py
index 0e1c1d8..2a3b41e 100644
--- a/bs4/tests/test_html5lib.py
+++ b/bs4/tests/test_html5lib.py
@@ -69,4 +69,4 @@ class HTML5LibBuilderSmokeTest(SoupTest, HTML5TreeBuilderSmokeTest):
</html>'''
soup = self.soup(markup)
# Verify that we can reach the <p> tag; this means the tree is connected.
- self.assertEquals("<p>foo</p>", soup.p.encode())
+ self.assertEqual(b"<p>foo</p>", soup.p.encode())
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 5d4c0fe..e254855 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -239,10 +239,10 @@ you might install lxml with one of these commands:
:kbd:`$ pip install lxml`
-If you're using Python 2, another alternative is the pure-Python
-`html5lib parser <http://code.google.com/p/html5lib/>`_, which parses
-HTML the way a web browser does. Depending on your setup, you might
-install html5lib with one of these commands:
+Another alternative is the pure-Python `html5lib parser
+<http://code.google.com/p/html5lib/>`_, which parses HTML the way a
+web browser does. Depending on your setup, you might install html5lib
+with one of these commands:
:kbd:`$ apt-get install python-html5lib`
@@ -270,7 +270,7 @@ This table summarizes the advantages and disadvantages of each parser library:
| html5lib | ``BeautifulSoup(markup, "html5lib")`` | * Extremely lenient | * Very slow |
| | | * Parses pages the same way a | * External Python |
| | | web browser does | dependency |
-| | | * Creates valid HTML5 | * Python 2 only |
+| | | * Creates valid HTML5 | |
+----------------------+--------------------------------------------+--------------------------------+--------------------------+
If you can, I recommend you install and use lxml for speed. If you're