diff options
| author | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
|---|---|---|
| committer | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
| commit | ecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch) | |
| tree | b89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/feedparser/files | |
| parent | 1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff) | |
| download | baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip | |
Updating liguros repo
Diffstat (limited to 'dev-python/feedparser/files')
| -rw-r--r-- | dev-python/feedparser/files/feedparser-5.2.1-sgmllib.patch | 78 | ||||
| -rw-r--r-- | dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch | 89 |
2 files changed, 167 insertions, 0 deletions
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 <sebastian@pipping.org> +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('<![CDATA[', '<![CDATA[') + p.feed(htmlSource) +@@ -3890,7 +3877,7 @@ def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, refer + result['bozo'] = 1 + result['bozo_exception'] = feedparser.exc or e + use_strict_parser = 0 +- if not use_strict_parser and _SGML_AVAILABLE: ++ if not use_strict_parser: + feedparser = _LooseFeedParser(baseuri, baselang, 'utf-8', entities) + feedparser.feed(data.decode('utf-8', 'replace')) + result['feed'] = feedparser.feeddata +diff --git a/setup.py b/setup.py +index a4a60fe..8c15451 100644 +--- a/setup.py ++++ b/setup.py +@@ -16,7 +16,7 @@ setup( + download_url = 'https://pypi.python.org/pypi/feedparser', + platforms = ['POSIX', 'Windows'], + package_dir = {'': 'feedparser'}, +- py_modules = ['feedparser'], ++ py_modules = ['feedparser', '_feedparser_sgmllib'], + keywords = ['atom', 'cdf', 'feed', 'parser', 'rdf', 'rss'], + classifiers = [ + 'Development Status :: 5 - Production/Stable', +-- +1.7.8.1 + diff --git a/dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch b/dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch new file mode 100644 index 000000000000..f9315e47809c --- /dev/null +++ b/dev-python/feedparser/files/feedparser-6.0.0_beta1-py39.patch @@ -0,0 +1,89 @@ +From fa587d171aed1b44ee06af271d718ab6fa73b77a Mon Sep 17 00:00:00 2001 +From: Karthikeyan Singaravelan <tir.karthi@gmail.com> +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 <tir.karthi@gmail.com> +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'') |
