[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/, dev-python/html5lib/files/
commit: 02cc2601e80e203f3f840a26977543674a013555 Author: Jakov Smolic sartura hr> AuthorDate: Thu May 6 23:56:09 2021 + Commit: Michał Górny gentoo org> CommitDate: Fri May 7 11:57:42 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02cc2601 dev-python/html5lib: Port to python3.10, support pytest-6 Closes: https://bugs.gentoo.org/754144 Signed-off-by: Jakov Smolic sartura.hr> Signed-off-by: Michał Górny gentoo.org> .../html5lib/files/html5lib-1.1-pytest6.patch | 153 + dev-python/html5lib/html5lib-1.1.ebuild| 9 +- 2 files changed, 158 insertions(+), 4 deletions(-) diff --git a/dev-python/html5lib/files/html5lib-1.1-pytest6.patch b/dev-python/html5lib/files/html5lib-1.1-pytest6.patch new file mode 100644 index 000..a511b40abea --- /dev/null +++ b/dev-python/html5lib/files/html5lib-1.1-pytest6.patch @@ -0,0 +1,153 @@ +# https://github.com/html5lib/html5lib-python/pull/506 +# https://bugs.gentoo.org/754144 +From e6bd99e8f2497194ffd0a06c6954ebb28d7526bb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Sat, 8 Aug 2020 13:39:22 +0200 +Subject: [PATCH] Use Node.from_parent() constructor to support pytest 6 + +Add a wrapper not to break pytest 4 (needed for Python 2 support). + += test session starts == +platform linux -- Python 3.9.0b5, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 +rootdir: /builddir/build/BUILD/html5lib-1.1, configfile: pytest.ini +plugins: expect-1.1.0 +collected 0 items / 1 error + + ERRORS + ERROR collecting test session _ +/usr/lib/python3.9/site-packages/pluggy/hooks.py:286: in __call__ +return self._hookexec(self, self.get_hookimpls(), kwargs) +/usr/lib/python3.9/site-packages/pluggy/manager.py:93: in _hookexec +return self._inner_hookexec(hook, methods, kwargs) +/usr/lib/python3.9/site-packages/pluggy/manager.py:84: in +self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( +html5lib/tests/conftest.py:105: in pytest_collect_file +return TokenizerFile(path, parent) +/usr/lib/python3.9/site-packages/_pytest/nodes.py:95: in __call__ +warnings.warn(NODE_USE_FROM_PARENT.format(name=self.__name__), stacklevel=2) +E pytest.PytestDeprecationWarning: Direct construction of TokenizerFile has been deprecated, please use TokenizerFile.from_parent. +E See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details. + +Fixes https://github.com/html5lib/html5lib-python/issues/505 +--- + html5lib/tests/conftest.py | 15 --- + html5lib/tests/sanitizer.py | 2 +- + html5lib/tests/tokenizer.py | 10 +- + html5lib/tests/tree_construction.py | 20 ++-- + requirements-test.txt | 2 +- + 5 files changed, 29 insertions(+), 20 deletions(-) + +diff --git a/html5lib/tests/conftest.py b/html5lib/tests/conftest.py +index dad167c5..fffeb50c 100644 +--- a/html5lib/tests/conftest.py b/html5lib/tests/conftest.py +@@ -99,10 +99,19 @@ def pytest_collect_file(path, parent): + + if _tree_construction in dir_and_parents: + if path.ext == ".dat": +-return TreeConstructionFile(path, parent) ++return TreeConstructionFile.from_parent(parent, fspath=path) + elif _tokenizer in dir_and_parents: + if path.ext == ".test": +-return TokenizerFile(path, parent) ++return TokenizerFile.from_parent(parent, fspath=path) + elif _sanitizer_testdata in dir_and_parents: + if path.ext == ".dat": +-return SanitizerFile(path, parent) ++return SanitizerFile.from_parent(parent, fspath=path) ++ ++ ++# Tiny wrapper to allow .from_parent constructors on older pytest for PY27 ++if not hasattr(pytest.Item.__base__, "from_parent"): ++@classmethod ++def from_parent(cls, parent, **kwargs): ++return cls(parent=parent, **kwargs) ++ ++pytest.Item.__base__.from_parent = from_parent +diff --git a/html5lib/tests/sanitizer.py b/html5lib/tests/sanitizer.py +index bb483421..16e53868 100644 +--- a/html5lib/tests/sanitizer.py b/html5lib/tests/sanitizer.py +@@ -13,7 +13,7 @@ def collect(self): + with codecs.open(str(self.fspath), "r", encoding="utf-8") as fp: + tests = json.load(fp) + for i, test in enumerate(tests): +-yield SanitizerTest(str(i), self, test=test) ++yield SanitizerTest.from_parent(self, name=str(i), test=test) + + + class SanitizerTest(pytest.Item): +diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py +index 47264cc3..cc9897a4 100644 +--- a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py +@@
[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/, dev-python/html5lib/files/
commit: 2df34ea62c58a482f2a85c25acfa8c58f52e9b51 Author: Michał Górny gentoo org> AuthorDate: Thu Oct 8 18:42:20 2020 + Commit: Michał Górny gentoo org> CommitDate: Thu Oct 8 18:42:20 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2df34ea6 dev-python/html5lib: Remove old Signed-off-by: Michał Górny gentoo.org> dev-python/html5lib/Manifest | 1 - .../files/html5lib-1.0.1-collections-abc.patch | 44 .../html5lib-python-1.0.1-support-pytest4.patch| 270 - dev-python/html5lib/html5lib-1.0.1-r2.ebuild | 37 --- 4 files changed, 352 deletions(-) diff --git a/dev-python/html5lib/Manifest b/dev-python/html5lib/Manifest index 03c605eb9e6..24a9ed5ed3c 100644 --- a/dev-python/html5lib/Manifest +++ b/dev-python/html5lib/Manifest @@ -1,2 +1 @@ -DIST html5lib-1.0.1.tar.gz 252959 BLAKE2B d2a9fa19d6a18b9e0c39f737a22ff4d5a6533734843f787c083f9497fd94788dad0e1e96478fe48b262c208370cf58e91ab94cc06a3e2757a40e936363cd3148 SHA512 35939b4450893864da04e735ee5e0addacf1dd34bae6a6909c76572abf6bfded446a78a713dfde91c1485ba45867d7abeb6a45cf0545c16ea968707be7de5dd2 DIST html5lib-1.1.tar.gz 272215 BLAKE2B 11a4fc3fb84bf8bab4af5da1de30b0892a9eb454505716b3db391187053c9aac159b1c82ae787896592b8fc850363bba9313b9d7fc617150771c3bfa1aeadefb SHA512 af7c29591007fded99be6c38e3d0ae5a4ac32d71d26046a615918ae732cb1c1ecbf754f47ceca1a53726c3843f3ecea7af87a7362281b45ff3af495815818626 diff --git a/dev-python/html5lib/files/html5lib-1.0.1-collections-abc.patch b/dev-python/html5lib/files/html5lib-1.0.1-collections-abc.patch deleted file mode 100644 index d5a9dcac299..000 --- a/dev-python/html5lib/files/html5lib-1.0.1-collections-abc.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4f9235752cea29c5a31721440578b430823a1e69 Mon Sep 17 00:00:00 2001 -From: 5j9 <5...@users.noreply.github.com> -Date: Mon, 1 Oct 2018 15:02:33 +0330 -Subject: [PATCH] Try to import MutableMapping from collections.abc (#403) - -Note that collections.abc has been added in Python 3.3. - -Fixes #402 - html5lib/_trie/_base.py | 5 - - html5lib/treebuilders/dom.py | 5 - - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/html5lib/_trie/_base.py b/html5lib/_trie/_base.py -index a1158bbb..6b71975f 100644 a/html5lib/_trie/_base.py -+++ b/html5lib/_trie/_base.py -@@ -1,6 +1,9 @@ - from __future__ import absolute_import, division, unicode_literals - --from collections import Mapping -+try: -+from collections.abc import Mapping -+except ImportError: # Python 2.7 -+from collections import Mapping - - - class Trie(Mapping): -diff --git a/html5lib/treebuilders/dom.py b/html5lib/treebuilders/dom.py -index dcfac220..d8b53004 100644 a/html5lib/treebuilders/dom.py -+++ b/html5lib/treebuilders/dom.py -@@ -1,7 +1,10 @@ - from __future__ import absolute_import, division, unicode_literals - - --from collections import MutableMapping -+try: -+from collections.abc import MutableMapping -+except ImportError: # Python 2.7 -+from collections import MutableMapping - from xml.dom import minidom, Node - import weakref - diff --git a/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch b/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch deleted file mode 100644 index 98c9fb23fc7..000 --- a/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch +++ /dev/null @@ -1,270 +0,0 @@ -From 2699544837e68b12f1740a7eb56882a0dc0a4008 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 28 Mar 2019 01:45:43 +0100 -Subject: [PATCH 1/4] Support pytest 4 - -Fixes https://github.com/html5lib/html5lib-python/issues/411 - html5lib/tests/test_encoding.py| 4 ++-- - html5lib/tests/test_sanitizer.py | 14 +++--- - html5lib/tests/test_serializer.py | 2 +- - html5lib/tests/test_stream.py | 7 --- - html5lib/tests/test_treewalkers.py | 2 +- - requirements-test.txt | 2 +- - tox.ini| 2 +- - 7 files changed, 17 insertions(+), 16 deletions(-) - -diff --git a/html5lib/tests/test_encoding.py b/html5lib/tests/test_encoding.py -index 9a411c77..97b6ca2a 100644 a/html5lib/tests/test_encoding.py -+++ b/html5lib/tests/test_encoding.py -@@ -99,8 +99,8 @@ def test_encoding(): - for filename in get_data_files("encoding"): - tests = _TestData(filename, b"data", encoding=None) - for test in tests: --yield (runParserEncodingTest, test[b'data'], test[b'encoding']) --yield (runPreScanEncodingTest, test[b'data'], test[b'encoding']) -+runParserEncodingTest(test[b'data'], test[b'encoding']) -+runPreScanEncodingTest(test[b'data'], test[b'encoding']) - - - # pylint:disable=wrong-import-position -diff --git a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py -index 45046d57..1b7285fc 100644
[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/, dev-python/html5lib/files/
commit: 861fb47c4f3c853ba2aabc53b0b6acbbeb7ceeaa Author: Patrick McLean sony com> AuthorDate: Tue Nov 26 23:53:34 2019 + Commit: Patrick McLean gentoo org> CommitDate: Wed Nov 27 01:13:37 2019 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=861fb47c dev-python/html5lib: revbump, EAPI=7, py38 Copyright: Sony Interactive Entertainment Inc. Package-Manager: Portage-2.3.79, Repoman-2.3.18 Signed-off-by: Patrick McLean gentoo.org> .../html5lib-python-1.0.1-support-pytest4.patch| 270 + ...l5lib-1.0.1.ebuild => html5lib-1.0.1-r1.ebuild} | 20 +- dev-python/html5lib/html5lib-1.0.1.ebuild | 2 + 3 files changed, 284 insertions(+), 8 deletions(-) diff --git a/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch b/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch new file mode 100644 index 000..98c9fb23fc7 --- /dev/null +++ b/dev-python/html5lib/files/html5lib-python-1.0.1-support-pytest4.patch @@ -0,0 +1,270 @@ +From 2699544837e68b12f1740a7eb56882a0dc0a4008 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 28 Mar 2019 01:45:43 +0100 +Subject: [PATCH 1/4] Support pytest 4 + +Fixes https://github.com/html5lib/html5lib-python/issues/411 +--- + html5lib/tests/test_encoding.py| 4 ++-- + html5lib/tests/test_sanitizer.py | 14 +++--- + html5lib/tests/test_serializer.py | 2 +- + html5lib/tests/test_stream.py | 7 --- + html5lib/tests/test_treewalkers.py | 2 +- + requirements-test.txt | 2 +- + tox.ini| 2 +- + 7 files changed, 17 insertions(+), 16 deletions(-) + +diff --git a/html5lib/tests/test_encoding.py b/html5lib/tests/test_encoding.py +index 9a411c77..97b6ca2a 100644 +--- a/html5lib/tests/test_encoding.py b/html5lib/tests/test_encoding.py +@@ -99,8 +99,8 @@ def test_encoding(): + for filename in get_data_files("encoding"): + tests = _TestData(filename, b"data", encoding=None) + for test in tests: +-yield (runParserEncodingTest, test[b'data'], test[b'encoding']) +-yield (runPreScanEncodingTest, test[b'data'], test[b'encoding']) ++runParserEncodingTest(test[b'data'], test[b'encoding']) ++runPreScanEncodingTest(test[b'data'], test[b'encoding']) + + + # pylint:disable=wrong-import-position +diff --git a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py +index 45046d57..1b7285fc 100644 +--- a/html5lib/tests/test_sanitizer.py b/html5lib/tests/test_sanitizer.py +@@ -67,19 +67,19 @@ def test_sanitizer(): + 'tfoot', 'th', 'thead', 'tr', 'select']: + continue # TODO + if tag_name == 'image': +-yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, ++runSanitizerTest("test_should_allow_%s_tag" % tag_name, +"foo badbar/bad baz", +"<%s title='1'>foo bar baz" % (tag_name, tag_name)) + elif tag_name == 'br': +-yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, ++runSanitizerTest("test_should_allow_%s_tag" % tag_name, +"foo badbar/bad baz", +"<%s title='1'>foo bar baz" % (tag_name, tag_name)) + elif tag_name in constants.voidElements: +-yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, ++runSanitizerTest("test_should_allow_%s_tag" % tag_name, +"<%s title=\"1\"/>foo badbar/bad baz" % tag_name, +"<%s title='1'>foo bar baz" % (tag_name, tag_name)) + else: +-yield (runSanitizerTest, "test_should_allow_%s_tag" % tag_name, ++runSanitizerTest("test_should_allow_%s_tag" % tag_name, +"<%s title=\"1\">foo badbar/bad baz" % (tag_name, tag_name), +"<%s title='1'>foo bar baz" % (tag_name, tag_name)) + +@@ -93,7 +93,7 @@ def test_sanitizer(): + attribute_value = 'foo' + if attribute_name in sanitizer.attr_val_is_uri: + attribute_value = '%s://sub.domain.tld/path/object.ext' % sanitizer.allowed_protocols[0] +-yield (runSanitizerTest, "test_should_allow_%s_attribute" % attribute_name, ++runSanitizerTest("test_should_allow_%s_attribute" % attribute_name, +"foo badbar/bad baz" % (attribute_name, attribute_value), +"foo bar baz" % (attribute_name, attribute_value)) + +@@ -101,7 +101,7 @@ def test_sanitizer(): + rest_of_uri = '//sub.domain.tld/path/object.ext' + if protocol == 'data': + rest_of_uri = 'image/png;base64,aGVsbG8gd29ybGQ=' +-yield (runSanitizerTest, "test_should_allow_uppercase_%s_uris" % protocol, ++runSanitizerTest("test_should_allow_uppercase_%s_uris" % protocol, +"foo" % (protocol, rest_of_uri), +
[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/, dev-python/html5lib/files/
commit: 9f660cebb2308bb021a128fdd699ea70ec383c6a Author: Michał Górny gentoo org> AuthorDate: Thu Jan 4 20:03:07 2018 + Commit: Michał Górny gentoo org> CommitDate: Thu Jan 4 20:34:53 2018 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f660ceb dev-python/html5lib: Clean old up .../html5lib-0.999-lxml-3.5.0-backport.patch | 117 - ...html5lib-0.999-python3.6-sanitizer-re.patch | 50 - dev-python/html5lib/html5lib-0.999-r2.ebuild | 32 -- 3 files changed, 199 deletions(-) diff --git a/dev-python/html5lib/files/html5lib-0.999-lxml-3.5.0-backport.patch b/dev-python/html5lib/files/html5lib-0.999-lxml-3.5.0-backport.patch deleted file mode 100644 index fecfab9a4fb..000 --- a/dev-python/html5lib/files/html5lib-0.999-lxml-3.5.0-backport.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 46046c0f7125911ff8205f09a7574573bb953105 Mon Sep 17 00:00:00 2001 -From: Geoffrey Sneddon-Date: Mon, 23 Nov 2015 15:17:07 + -Subject: [PATCH 1/3] Make lxml tree-builder coerce comments to work with lxml - 3.5. - - html5lib/ihatexml.py| 2 ++ - html5lib/treebuilders/etree_lxml.py | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/html5lib/ihatexml.py b/html5lib/ihatexml.py -index 0fc7930..b5b2e98 100644 a/html5lib/ihatexml.py -+++ b/html5lib/ihatexml.py -@@ -225,6 +225,8 @@ def coerceComment(self, data): - while "--" in data: - warnings.warn("Comments cannot contain adjacent dashes", DataLossWarning) - data = data.replace("--", "- -") -+if data.endswith("-"): -+data += " " - return data - - def coerceCharacters(self, data): -diff --git a/html5lib/treebuilders/etree_lxml.py b/html5lib/treebuilders/etree_lxml.py -index 35d08ef..17007e3 100644 a/html5lib/treebuilders/etree_lxml.py -+++ b/html5lib/treebuilders/etree_lxml.py -@@ -189,7 +189,7 @@ class TreeBuilder(_base.TreeBuilder): - - def __init__(self, namespaceHTMLElements, fullTree=False): - builder = etree_builders.getETreeModule(etree, fullTree=fullTree) --infosetFilter = self.infosetFilter = ihatexml.InfosetFilter() -+infosetFilter = self.infosetFilter = ihatexml.InfosetFilter(preventDoubleDashComments=True) - self.namespaceHTMLElements = namespaceHTMLElements - - class Attributes(dict): - -From 1c22e1ce93dd4acc81a66cfa03cf9720fbd741c7 Mon Sep 17 00:00:00 2001 -From: Geoffrey Sneddon -Date: Mon, 23 Nov 2015 15:35:21 + -Subject: [PATCH 2/3] fixup! Make lxml tree-builder coerce comments to work - with lxml 3.5. - - html5lib/ihatexml.py| 1 + - html5lib/treebuilders/etree_lxml.py | 7 --- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/html5lib/ihatexml.py b/html5lib/ihatexml.py -index b5b2e98..5a81a12 100644 a/html5lib/ihatexml.py -+++ b/html5lib/ihatexml.py -@@ -226,6 +226,7 @@ def coerceComment(self, data): - warnings.warn("Comments cannot contain adjacent dashes", DataLossWarning) - data = data.replace("--", "- -") - if data.endswith("-"): -+warnings.warn("Comments cannot contain end in a dash", DataLossWarning) - data += " " - return data - -diff --git a/html5lib/treebuilders/etree_lxml.py b/html5lib/treebuilders/etree_lxml.py -index 17007e3..c6c981f 100644 a/html5lib/treebuilders/etree_lxml.py -+++ b/html5lib/treebuilders/etree_lxml.py -@@ -54,7 +54,7 @@ def _getChildNodes(self): - def testSerializer(element): - rv = [] - finalText = None --infosetFilter = ihatexml.InfosetFilter() -+infosetFilter = ihatexml.InfosetFilter(preventDoubleDashComments=True) - - def serializeElement(element, indent=0): - if not hasattr(element, "tag"): -@@ -257,7 +257,7 @@ def _getData(self): - data = property(_getData, _setData) - - self.elementClass = Element --self.commentClass = builder.Comment -+self.commentClass = Comment - # self.fragmentClass = builder.DocumentFragment - _base.TreeBuilder.__init__(self, namespaceHTMLElements) - -@@ -344,7 +344,8 @@ def insertRoot(self, token): - - # Append the initial comments: - for comment_token in self.initial_comments: --root.addprevious(etree.Comment(comment_token["data"])) -+comment = self.commentClass(comment_token["data"]) -+root.addprevious(comment._element) - - # Create the root document and add the ElementTree to it - self.document = self.documentClass() - -From 235a6d7ac7e0a3e2b431766e051094c2d3110ba3 Mon Sep 17 00:00:00 2001 -From: Geoffrey Sneddon -Date: Mon, 23 Nov 2015 15:42:12 + -Subject: [PATCH 3/3] fixup! Make lxml tree-builder coerce comments to work - with lxml 3.5. - -
[gentoo-commits] repo/gentoo:master commit in: dev-python/html5lib/, dev-python/html5lib/files/
commit: b056103962b4ecff159549327f4b5219ebdfafaf Author: Zac Medico gentoo org> AuthorDate: Tue Mar 28 18:41:17 2017 + Commit: Zac Medico gentoo org> CommitDate: Tue Mar 28 19:05:34 2017 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0561039 dev-python/html5lib: fix for python3.6 (bug 613656) Package-Manager: Portage-2.3.5, Repoman-2.3.2 ...html5lib-0.999-python3.6-sanitizer-re.patch | 50 ++ ...-r1.ebuild => html5lib-0.999-r2.ebuild} | 1 + 2 files changed, 51 insertions(+) diff --git a/dev-python/html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch b/dev-python/html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch new file mode 100644 index 000..c64cbe1ab3f --- /dev/null +++ b/dev-python/html5lib/files/html5lib-0.999-python3.6-sanitizer-re.patch @@ -0,0 +1,50 @@ +--- a/html5lib/sanitizer.py b/html5lib/sanitizer.py +@@ -203,7 +203,7 @@ + for attr in self.attr_val_is_uri: + if attr not in attrs: + continue +-val_unescaped = re.sub("[`\000-\040\177-\240\s]+", '', ++val_unescaped = re.sub(r"[`\000-\040\177-\240\s]+", '', +unescape(attrs[attr])).lower() + # remove replacement characters from unescaped characters + val_unescaped = val_unescaped.replace("\ufffd", "") +@@ -228,7 +228,7 @@ + ' ', + unescape(attrs[attr])) + if (token["name"] in self.svg_allow_local_href and +-'xlink:href' in attrs and re.search('^\s*[^#\s].*', ++'xlink:href' in attrs and re.search(r'^\s*[^#\s].*', + attrs['xlink:href'])): + del attrs['xlink:href'] + if 'style' in attrs: +@@ -257,16 +257,16 @@ + + def sanitize_css(self, style): + # disallow urls +-style = re.compile('url\s*\(\s*[^\s)]+?\s*\)\s*').sub(' ', style) ++style = re.compile(r'url\s*\(\s*[^\s)]+?\s*\)\s*').sub(' ', style) + + # gauntlet +-if not re.match("""^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+'|"[\s\w]+"|\([\d,\s]+\))*$""", style): ++if not re.match(r"""^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+'|"[\s\w]+"|\([\d,\s]+\))*$""", style): + return '' +-if not re.match("^\s*([-\w]+\s*:[^:;]*(;\s*|$))*$", style): ++if not re.match(r"^\s*([-\w]+\s*:[^:;]*(;\s*|$))*$", style): + return '' + + clean = [] +-for prop, value in re.findall("([-\w]+)\s*:\s*([^:;]*)", style): ++for prop, value in re.findall(r"([-\w]+)\s*:\s*([^:;]*)", style): + if not value: + continue + if prop.lower() in self.allowed_css_properties: +@@ -275,7 +275,7 @@ + 'padding']: + for keyword in value.split(): + if keyword not in self.acceptable_css_keywords and \ +-not re.match("^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$", keyword): ++not re.match(r"^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$", keyword): + break + else: + clean.append(prop + ': ' + value + ';') diff --git a/dev-python/html5lib/html5lib-0.999-r1.ebuild b/dev-python/html5lib/html5lib-0.999-r2.ebuild similarity index 94% rename from dev-python/html5lib/html5lib-0.999-r1.ebuild rename to dev-python/html5lib/html5lib-0.999-r2.ebuild index 44163d3c076..5b23d984fc3 100644 --- a/dev-python/html5lib/html5lib-0.999-r1.ebuild +++ b/dev-python/html5lib/html5lib-0.999-r2.ebuild @@ -24,6 +24,7 @@ DEPEND="${RDEPEND} PATCHES=( "${FILESDIR}"/${P}-lxml-3.5.0-backport.patch + "${FILESDIR}"/${P}-python3.6-sanitizer-re.patch ) python_test() {