Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-Protego for openSUSE:Factory checked in at 2022-10-18 12:44:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Protego (Old) and /work/SRC/openSUSE:Factory/.python-Protego.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Protego" Tue Oct 18 12:44:54 2022 rev:3 rq:1012109 version:0.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Protego/python-Protego.changes 2022-08-20 20:29:15.621452066 +0200 +++ /work/SRC/openSUSE:Factory/.python-Protego.new.2275/python-Protego.changes 2022-10-18 12:45:18.565766020 +0200 @@ -1,0 +2,7 @@ +Mon Oct 17 11:32:31 UTC 2022 - pgaj...@suse.com + +- added patches + fix https://github.com/scrapy/protego/issues/31 + + python-Protego-no-six.patch + +------------------------------------------------------------------- New: ---- python-Protego-no-six.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Protego.spec ++++++ --- /var/tmp/diff_new_pack.9t0Tzd/_old 2022-10-18 12:45:18.985766976 +0200 +++ /var/tmp/diff_new_pack.9t0Tzd/_new 2022-10-18 12:45:18.993766994 +0200 @@ -25,6 +25,8 @@ Group: Development/Languages/Python URL: https://github.com/scrapy/protego Source: https://files.pythonhosted.org/packages/source/P/Protego/Protego-%{version}.tar.gz +# https://github.com/scrapy/protego/issues/31 +Patch0: python-Protego-no-six.patch BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} @@ -39,6 +41,7 @@ %prep %setup -q -n Protego-%{version} +%patch0 -p1 %build %python_build ++++++ python-Protego-no-six.patch ++++++ Index: Protego-0.2.1/src/protego.py =================================================================== --- Protego-0.2.1.orig/src/protego.py +++ Protego-0.2.1/src/protego.py @@ -3,9 +3,8 @@ import re from collections import namedtuple from datetime import time -import six -from six.moves.urllib.parse import (ParseResult, quote, urlparse, - urlunparse) +from urllib.parse import (ParseResult, quote, urlparse, + urlunparse) logger = logging.getLogger(__name__) @@ -122,8 +121,6 @@ class _RuleSet(object): def hex_to_byte(h): """Replaces a %xx escape with equivalent binary sequence.""" - if six.PY2: - return chr(int(h, 16)) return bytes.fromhex(h) # ignore contains %xy escapes for characters that are not @@ -162,11 +159,7 @@ class _RuleSet(object): """Return percent encoded path.""" parts = urlparse(path) path = self._unquote(parts.path, ignore='/%') - # quote do not work with unicode strings in Python 2.7 - if six.PY2: - path = quote(path.encode('utf-8'), safe='/%') - else: - path = quote(path, safe='/%') + path = quote(path, safe='/%') parts = ParseResult('', '', path, parts.params, parts.query, parts.fragment) path = urlunparse(parts) @@ -182,11 +175,7 @@ class _RuleSet(object): parts = urlparse(pattern) pattern = self._unquote(parts.path, ignore='/*$%') - # quote do not work with unicode strings in Python 2.7 - if six.PY2: - pattern = quote(pattern.encode('utf-8'), safe='/*%') - else: - pattern = quote(pattern, safe='/*%') + pattern = quote(pattern, safe='/*%') parts = ParseResult('', '', pattern + last_char, parts.params, parts.query, parts.fragment) pattern = urlunparse(parts)