diff options
author | Leonard Richardson <leonardr@segfault.org> | 2016-07-18 22:24:43 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2016-07-18 22:24:43 -0400 |
commit | 3ceef105f8384d649ec1c0cf79557b5fcade5cf3 (patch) | |
tree | cd9e402eca37c188bf386e6e43eff7b5a2140bdc | |
parent | ff95d577bfcec85cca29b6f7041a508db7d8d841 (diff) |
Pass in bytes so that the BeautifulSoup object always has an original_encoding.
-rw-r--r-- | bs4/tests/test_tree.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index 6bcf8af..dcee6de 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -1340,7 +1340,7 @@ class TestPersistence(SoupTest): self.assertEqual(copied.decode(), self.tree.decode()) def test_copy_preserves_encoding(self): - soup = BeautifulSoup('<p> </p>', 'html.parser') + soup = BeautifulSoup(b'<p> </p>', 'html.parser') self.assertEqual('ascii', soup.original_encoding) copy = soup.__copy__() self.assertEqual(u"<p> </p>", unicode(copy)) |