diff --git a/beautifulsoup4-lxml-fixes.patch b/beautifulsoup4-lxml-fixes.patch
new file mode 100644
index 0000000..00ff53b
--- /dev/null
+++ b/beautifulsoup4-lxml-fixes.patch
@@ -0,0 +1,23 @@
+diff -ruN a/bs4/testing.py b/bs4/testing.py
+--- a/bs4/testing.py 2013-06-10 15:16:25.000000000 +0200
++++ b/bs4/testing.py 2014-01-08 16:09:35.845681062 +0100
+@@ -493,7 +493,7 @@
+ self.assertTrue(b"< < hey > >" in encoded)
+
+ def test_can_parse_unicode_document(self):
+- markup = u'Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!'
++ markup = u'Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!'
+ soup = self.soup(markup)
+ self.assertEqual(u'Sacr\xe9 bleu!', soup.root.string)
+
+diff -ruN a/bs4/tests/test_lxml.py b/bs4/tests/test_lxml.py
+--- a/bs4/tests/test_lxml.py 2013-08-19 16:29:42.000000000 +0200
++++ b/bs4/tests/test_lxml.py 2014-01-08 16:10:33.157497450 +0100
+@@ -61,6 +61,7 @@
+ # Make sure that the deprecated BSS class uses an xml builder
+ # if one is installed.
+ with warnings.catch_warnings(record=True) as w:
++ warnings.simplefilter("always")
+ soup = BeautifulStoneSoup("")
+ self.assertEqual(u"", unicode(soup.b))
+ self.assertTrue("BeautifulStoneSoup class is deprecated" in str(w[0].message))
diff --git a/python-beautifulsoup4.changes b/python-beautifulsoup4.changes
index 7689a95..b64ae2c 100644
--- a/python-beautifulsoup4.changes
+++ b/python-beautifulsoup4.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Wed Jan 8 15:05:55 UTC 2014 - speilicke@suse.com
+
+- Add beautifulsoup4-lxml-fixes.patch: LXML fixes
+
-------------------------------------------------------------------
Tue Oct 22 13:00:00 UTC 2013 - toddrme2178@gmail.com
diff --git a/python-beautifulsoup4.spec b/python-beautifulsoup4.spec
index a22dc3c..823ddf2 100644
--- a/python-beautifulsoup4.spec
+++ b/python-beautifulsoup4.spec
@@ -1,7 +1,7 @@
#
# spec file for package python-beautifulsoup4
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,6 +24,8 @@ License: MIT
Group: Development/Libraries/Python
Url: http://www.crummy.com/software/BeautifulSoup/
Source: http://pypi.python.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM speilicke@suse.com -- Backport of https://code.launchpad.net/~saschpe/beautifulsoup/beautifulsoup/+merge/200849
+Patch0: beautifulsoup4-lxml-fixes.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel >= 2.6
BuildRequires: python-html5lib
@@ -75,14 +77,13 @@ Recommends: %{name} = %{version}
%description doc
Documentation and help files for %{name}
-
%prep
%setup -q -n beautifulsoup4-%{version}
+%patch0 -p1
%build
python setup.py build
-cd doc && make html
-rm build/html/.buildinfo
+cd doc && make html && rm build/html/.buildinfo
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}