From ecdac123787b96ce6649f0f91da12ea6458cc2b1 Mon Sep 17 00:00:00 2001 From: Palica Date: Tue, 23 Jun 2020 22:35:08 +0200 Subject: Updating liguros repo --- .../files/feedparser-5.2.1-sgmllib.patch | 78 +++++++++++++++++++ .../files/feedparser-6.0.0_beta1-py39.patch | 89 ++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch create mode 100644 dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch (limited to 'dev-python/feedparser/files') diff --git a/dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch b/dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch new file mode 100644 index 000000000000..714480560e52 --- /dev/null +++ b/dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch @@ -0,0 +1,78 @@ +From 812793c07d3202d3f5bc39091aec2e7071d000c8 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Sun, 1 Jan 2012 19:30:57 +0100 +Subject: [PATCH] Use shipped sgmllib for Python 3.x + +--- + feedparser/feedparser.py | 19 +++---------------- + setup.py | 2 +- + 2 files changed, 4 insertions(+), 17 deletions(-) + +diff --git a/feedparser/feedparser.py b/feedparser/feedparser.py +index 8275c29..9a8a053 100644 +--- a/feedparser/feedparser.py ++++ b/feedparser/feedparser.py +@@ -204,17 +204,9 @@ else: + try: + import sgmllib + except ImportError: +- # This is probably Python 3, which doesn't include sgmllib anymore +- _SGML_AVAILABLE = 0 ++ import _feedparser_sgmllib as sgmllib + +- # Mock sgmllib enough to allow subclassing later on +- class sgmllib(object): +- class SGMLParser(object): +- def goahead(self, i): +- pass +- def parse_starttag(self, i): +- pass +-else: ++if True: + _SGML_AVAILABLE = 1 + + # sgmllib defines a number of module-level regular expressions that are +@@ -2520,9 +2512,6 @@ class _RelativeURIResolver(_BaseHTMLProcessor): + _BaseHTMLProcessor.unknown_starttag(self, tag, attrs) + + def _resolveRelativeURIs(htmlSource, baseURI, encoding, _type): +- if not _SGML_AVAILABLE: +- return htmlSource +- + p = _RelativeURIResolver(baseURI, encoding, _type) + p.feed(htmlSource) + return p.output() +@@ -2803,8 +2792,6 @@ class _HTMLSanitizer(_BaseHTMLProcessor): + + + def _sanitizeHTML(htmlSource, encoding, _type): +- if not _SGML_AVAILABLE: +- return htmlSource + p = _HTMLSanitizer(encoding, _type) + htmlSource = htmlSource.replace(' +Date: Wed, 26 Feb 2020 22:06:39 +0530 +Subject: [PATCH 1/2] Use encodebytes instead of encodestring in Python 3.9. + +--- + feedparser/http.py | 5 ++++- + feedparser/mixin.py | 5 ++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/feedparser/http.py b/feedparser/http.py +index 272faad6..53511f02 100644 +--- a/feedparser/http.py ++++ b/feedparser/http.py +@@ -73,7 +73,10 @@ class request(object): + + # Python 3.1 deprecated decodestring in favor of decodebytes. + # This can be removed after Python 2.7 support is dropped. +-_base64decode = getattr(base64, 'decodebytes', base64.decodestring) ++try: ++ _base64decode = base64.decodebytes ++except AttributeError: ++ _base64decode = base64.decodestring + + try: + basestring +diff --git a/feedparser/mixin.py b/feedparser/mixin.py +index 1b0dc1ae..549931f5 100644 +--- a/feedparser/mixin.py ++++ b/feedparser/mixin.py +@@ -50,7 +50,10 @@ + + # Python 2.7 only offers "decodestring()". + # This name substitution can be removed when Python 2.7 support is dropped. +-_base64decode = getattr(base64, 'decodebytes', base64.decodestring) ++try: ++ _base64decode = base64.decodebytes ++except AttributeError: ++ _base64decode = base64.decodestring + + + bytes_ = type(b'') + +From 7798957b66c9cee00db9a18f84c518cacf8f14aa Mon Sep 17 00:00:00 2001 +From: Karthikeyan Singaravelan +Date: Sun, 17 May 2020 14:25:17 +0000 +Subject: [PATCH 2/2] Use base64.decodebytes only in Python 3 + +--- + feedparser/http.py | 7 +------ + feedparser/mixin.py | 7 +------ + 2 files changed, 2 insertions(+), 12 deletions(-) + +diff --git a/feedparser/http.py b/feedparser/http.py +index 53511f02..1119cb3b 100644 +--- a/feedparser/http.py ++++ b/feedparser/http.py +@@ -71,12 +71,7 @@ class request(object): + from .datetimes import _parse_date + from .urls import convert_to_idn + +-# Python 3.1 deprecated decodestring in favor of decodebytes. +-# This can be removed after Python 2.7 support is dropped. +-try: +- _base64decode = base64.decodebytes +-except AttributeError: +- _base64decode = base64.decodestring ++_base64decode = base64.decodebytes + + try: + basestring +diff --git a/feedparser/mixin.py b/feedparser/mixin.py +index 549931f5..119fa4ca 100644 +--- a/feedparser/mixin.py ++++ b/feedparser/mixin.py +@@ -48,12 +48,7 @@ + from .urls import _urljoin, make_safe_absolute_uri, resolve_relative_uris + + +-# Python 2.7 only offers "decodestring()". +-# This name substitution can be removed when Python 2.7 support is dropped. +-try: +- _base64decode = base64.decodebytes +-except AttributeError: +- _base64decode = base64.decodestring ++_base64decode = base64.decodebytes + + + bytes_ = type(b'') -- cgit v1.3.1