From 21fdee60188472e25004c1cbc39e2420331657fcbd2d7062c32f43af90122dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 29 May 2020 09:06:37 +0000 Subject: [PATCH] Accepting request 810151 from home:mcalabkova:branches:devel:languages:python - Update to 20.3.0 * drop Python 2 * twisted.news is deprecated. * twisted.conch.ssh now supports the curve25519-sha256 key exchange algorithm (requires OpenSSL >= 1.1.0). * many bugfixes and other miscelaneous fixes - Fixed update-alternatives mechanism - Added true-binary.patch - Dropped python-38-xml-namespace.patch - Reapplied python-38-hmac-digestmod.patch OBS-URL: https://build.opensuse.org/request/show/810151 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Twisted?expand=0&rev=91 --- Twisted-19.10.0.tar.bz2 | 3 -- Twisted-20.3.0.tar.bz2 | 3 ++ python-38-hmac-digestmod.patch | 22 ----------- python-38-xml-namespace.patch | 72 ---------------------------------- python-Twisted.changes | 14 +++++++ python-Twisted.spec | 61 ++++++---------------------- true-binary.patch | 22 +++++++++++ 7 files changed, 52 insertions(+), 145 deletions(-) delete mode 100644 Twisted-19.10.0.tar.bz2 create mode 100644 Twisted-20.3.0.tar.bz2 delete mode 100644 python-38-xml-namespace.patch create mode 100644 true-binary.patch diff --git a/Twisted-19.10.0.tar.bz2 b/Twisted-19.10.0.tar.bz2 deleted file mode 100644 index 60dd87b..0000000 --- a/Twisted-19.10.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d -size 3118485 diff --git a/Twisted-20.3.0.tar.bz2 b/Twisted-20.3.0.tar.bz2 new file mode 100644 index 0000000..5e34dd3 --- /dev/null +++ b/Twisted-20.3.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d72c55b5d56e176563b91d11952d13b01af8725c623e498db5507b6614fc1e10 +size 3127793 diff --git a/python-38-hmac-digestmod.patch b/python-38-hmac-digestmod.patch index 1ff4be4..746693f 100644 --- a/python-38-hmac-digestmod.patch +++ b/python-38-hmac-digestmod.patch @@ -52,28 +52,6 @@ Index: Twisted-19.10.0/src/twisted/cred/test/test_cramauth.py self.assertTrue(c.checkPassword(b'supersecret')) self.assertEqual(c.username, b"squirrel") -Index: Twisted-19.10.0/src/twisted/mail/_cred.py -=================================================================== ---- Twisted-19.10.0.orig/src/twisted/mail/_cred.py -+++ Twisted-19.10.0/src/twisted/mail/_cred.py -@@ -7,6 +7,7 @@ Credential managers for L{twisted.mail}. - - from __future__ import absolute_import, division - -+from hashlib import md5 - import hmac - - from zope.interface import implementer -@@ -28,7 +29,8 @@ class CramMD5ClientAuthenticator: - - - def challengeResponse(self, secret, chal): -- response = hmac.HMAC(secret, chal).hexdigest().encode('ascii') -+ response = hmac.HMAC( -+ secret, chal, digestmod=md5).hexdigest().encode('ascii') - return self.user + b' ' + response - - Index: Twisted-19.10.0/src/twisted/mail/test/test_pop3.py =================================================================== --- Twisted-19.10.0.orig/src/twisted/mail/test/test_pop3.py diff --git a/python-38-xml-namespace.patch b/python-38-xml-namespace.patch deleted file mode 100644 index c306581..0000000 --- a/python-38-xml-namespace.patch +++ /dev/null @@ -1,72 +0,0 @@ -From e42ba68b39f0ae98f1ea89a38a9317f2966c7d0e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Poisson?= -Date: Sun, 17 Nov 2019 19:48:53 +0100 -Subject: [PATCH] Fix parsing of namespaced attributes with Python 3.8 in - twisted.words.xish.domish.ExpatElementStream - ---- - src/twisted/words/newsfragments/9730.bugfix | 1 + - src/twisted/words/test/test_domish.py | 16 ++++++++++++++++ - src/twisted/words/xish/domish.py | 11 +++++++++-- - 3 files changed, 26 insertions(+), 2 deletions(-) - create mode 100644 src/twisted/words/newsfragments/9730.bugfix - -diff --git a/src/twisted/words/newsfragments/9730.bugfix b/src/twisted/words/newsfragments/9730.bugfix -new file mode 100644 -index 00000000000..5c91305c8f7 ---- /dev/null -+++ b/src/twisted/words/newsfragments/9730.bugfix -@@ -0,0 +1 @@ -+Fixed parsing of streams with Python 3.8 when there are spaces in namespaces or namespaced attributes in twisted.words.xish.domish.ExpatElementStream -diff --git a/src/twisted/words/test/test_domish.py b/src/twisted/words/test/test_domish.py -index a8f8fa76b63..5a691270443 100644 ---- a/src/twisted/words/test/test_domish.py -+++ b/src/twisted/words/test/test_domish.py -@@ -350,6 +350,22 @@ def test_namespaceWithWhitespace(self): - self.elements[0].attributes, {(" bar baz ", "baz"): "quux"}) - - -+ def test_attributesWithNamespaces(self): -+ """ -+ Attributes with namespace are parsed correctly (#9730 regression test). -+ """ -+ -+ xml = b""" -+ test -+ """ -+ -+ # with Python 3.8 and without #9730 fix, the following error would -+ # happen at next line: -+ # ``RuntimeError: dictionary keys changed during iteration`` -+ self.stream.parse(xml) -+ self.assertEqual(self.elements[0].uri, "http://example.org") -+ -+ - def testChildPrefix(self): - xml = b"" - -diff --git a/src/twisted/words/xish/domish.py b/src/twisted/words/xish/domish.py -index 2063c410a3c..30e47458f82 100644 ---- a/src/twisted/words/xish/domish.py -+++ b/src/twisted/words/xish/domish.py -@@ -807,11 +807,18 @@ def _onStartElement(self, name, attrs): - qname = ('', name) - - # Process attributes -+ new_attrs = {} -+ to_delete = [] - for k, v in attrs.items(): - if " " in k: - aqname = k.rsplit(" ", 1) -- attrs[(aqname[0], aqname[1])] = v -- del attrs[k] -+ new_attrs[(aqname[0], aqname[1])] = v -+ to_delete.append(k) -+ -+ attrs.update(new_attrs) -+ -+ for k in to_delete: -+ del attrs[k] - - # Construct the new element - e = Element(qname, self.defaultNsStack[-1], attrs, self.localPrefixes) diff --git a/python-Twisted.changes b/python-Twisted.changes index c53c23a..4394209 100644 --- a/python-Twisted.changes +++ b/python-Twisted.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Thu May 28 12:43:51 UTC 2020 - Marketa Calabkova + +- Update to 20.3.0 + * drop Python 2 + * twisted.news is deprecated. + * twisted.conch.ssh now supports the curve25519-sha256 key exchange + algorithm (requires OpenSSL >= 1.1.0). + * many bugfixes and other miscelaneous fixes +- Fixed update-alternatives mechanism +- Added true-binary.patch +- Dropped python-38-xml-namespace.patch +- Reapplied python-38-hmac-digestmod.patch + ------------------------------------------------------------------- Mon May 18 13:15:58 UTC 2020 - Petr Gajdos diff --git a/python-Twisted.spec b/python-Twisted.spec index 2843620..e0cb362 100644 --- a/python-Twisted.spec +++ b/python-Twisted.spec @@ -17,10 +17,10 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define oldpython python %define modname Twisted +%define skip_python2 1 Name: python-Twisted -Version: 19.10.0 +Version: 20.3.0 Release: 0 Summary: An asynchronous networking framework written in Python License: MIT @@ -30,20 +30,20 @@ Source: https://files.pythonhosted.org/packages/source/T/Twisted/%{modna Patch1: skip_MultiCast.patch Patch2: no-pygtkcompat.patch Patch3: test-mktime-invalid-tm_isdst.patch -Patch4: python-38-xml-namespace.patch Patch5: python-38-hmac-digestmod.patch Patch6: python-38-no-cgi-parseqs.patch +Patch7: true-binary.patch BuildRequires: %{python_module Automat >= 0.3.0} BuildRequires: %{python_module PyHamcrest >= 1.9.0} BuildRequires: %{python_module appdirs >= 1.4.0} -BuildRequires: %{python_module attrs >= 17.4.0} +BuildRequires: %{python_module attrs >= 19.2.0} BuildRequires: %{python_module bcrypt >= 3.0.0} BuildRequires: %{python_module constantly >= 15.1} -BuildRequires: %{python_module cryptography >= 2.5} +BuildRequires: %{python_module cryptography >= 2.6} BuildRequires: %{python_module devel} BuildRequires: %{python_module h2 >= 3.0} BuildRequires: %{python_module hyperlink >= 17.1.1} -BuildRequires: %{python_module idna >= 0.6} +BuildRequires: %{python_module idna >= 2.4} BuildRequires: %{python_module incremental >= 16.10.1} BuildRequires: %{python_module pyOpenSSL >= 16.0.0} BuildRequires: %{python_module pyasn1} @@ -60,13 +60,13 @@ BuildRequires: python-rpm-macros Requires: python-Automat >= 0.3.0 Requires: python-PyHamcrest >= 1.9.0 Requires: python-appdirs >= 1.4.0 -Requires: python-attrs >= 17.4.0 +Requires: python-attrs >= 19.2.0 Requires: python-bcrypt >= 3.0.0 Requires: python-constantly >= 15.1 -Requires: python-cryptography >= 2.5 +Requires: python-cryptography >= 2.6 Requires: python-h2 >= 3.0 Requires: python-hyperlink >= 17.1.1 -Requires: python-idna >= 0.6 +Requires: python-idna >= 2.4 Requires: python-incremental >= 16.10.1 Requires: python-pyOpenSSL >= 16.0.0 Requires: python-pyasn1 @@ -75,30 +75,6 @@ Requires: python-service_identity >= 18.1.0 Requires: python-zope.interface >= 4.4.2 Requires(post): update-alternatives Requires(postun): update-alternatives -%ifpython2 -Provides: %{oldpython}-twisted = %{version} -Obsoletes: %{oldpython}-twisted < %{version} -Provides: %{oldpython}-twisted-core = %{version} -Obsoletes: %{oldpython}-twisted-core < %{version} -Provides: %{oldpython}-twisted-conch = %{version} -Obsoletes: %{oldpython}-twisted-conch < %{version} -Provides: %{oldpython}-twisted-lore = %{version} -Obsoletes: %{oldpython}-twisted-lore < %{version} -Provides: %{oldpython}-twisted-mail = %{version} -Obsoletes: %{oldpython}-twisted-mail < %{version} -Provides: %{oldpython}-twisted-names = %{version} -Obsoletes: %{oldpython}-twisted-names < %{version} -Provides: %{oldpython}-twisted-news = %{version} -Obsoletes: %{oldpython}-twisted-news < %{version} -Provides: %{oldpython}-twisted-runner = %{version} -Obsoletes: %{oldpython}-twisted-runner < %{version} -Provides: %{oldpython}-twisted-web = %{version} -Obsoletes: %{oldpython}-twisted-web < %{version} -Provides: %{oldpython}-twisted-words = %{version} -Obsoletes: %{oldpython}-twisted-words < %{version} -Provides: %{oldpython}-twisted-xish = %{version} -Obsoletes: %{oldpython}-twisted-xish < %{version} -%endif %python_subpackages %description @@ -133,21 +109,15 @@ find docs -type f -print0 | xargs -0 chmod a-x # Fix doc-file dependency by remo # Prepare for update-alternatives usage for p in twistd cftp ckeygen conch pyhtmlizer tkconch trial ; do - %python_clone %{buildroot}%{_bindir}/$p - %python_clone %{buildroot}%{_mandir}/man1/$p.1 + %python_clone -a %{buildroot}%{_bindir}/$p + %python_clone -a %{buildroot}%{_mandir}/man1/$p.1 done -# update alternatives for parts supported only in python2 -%ifpython2 -%python_clone %{buildroot}%{_bindir}/mailmail -%python_clone %{buildroot}%{_mandir}/man1/mailmail.1 -%endif -%if ! 0%{?have_python2} || 0%{?skip_python2} +# mailmail is useful only on Python 2 rm %{buildroot}%{_bindir}/mailmail %{buildroot}%{_mandir}/man1/mailmail.1 -%endif # no manpage for twist yet: -%python_clone %{buildroot}%{_bindir}/twist +%python_clone -a %{buildroot}%{_bindir}/twist %check export LANG=en_US.UTF-8 @@ -181,14 +151,10 @@ export PYTHONDONTWRITEBYTECODE=1 %files %{python_files} %license LICENSE %doc NEWS.rst README.rst -%{_bindir}/*-%{python_bin_suffix} -%{_mandir}/man1/*-%{python_bin_suffix}.1%{?ext_man} %python_alternative %{_bindir}/twistd %python_alternative %{_bindir}/cftp %python_alternative %{_bindir}/ckeygen %python_alternative %{_bindir}/conch -# Supported only in python2 -%python2_only %{_bindir}/mailmail %python_alternative %{_bindir}/pyhtmlizer %python_alternative %{_bindir}/tkconch %python_alternative %{_bindir}/trial @@ -197,7 +163,6 @@ export PYTHONDONTWRITEBYTECODE=1 %python_alternative %{_mandir}/man1/cftp.1%{?ext_man} %python_alternative %{_mandir}/man1/ckeygen.1%{?ext_man} %python_alternative %{_mandir}/man1/conch.1%{?ext_man} -%python2_only %{_mandir}/man1/mailmail.1%{?ext_man} %python_alternative %{_mandir}/man1/pyhtmlizer.1%{?ext_man} %python_alternative %{_mandir}/man1/tkconch.1%{?ext_man} %python_alternative %{_mandir}/man1/trial.1%{?ext_man} diff --git a/true-binary.patch b/true-binary.patch new file mode 100644 index 0000000..e940e3c --- /dev/null +++ b/true-binary.patch @@ -0,0 +1,22 @@ +Index: Twisted-20.3.0/src/twisted/conch/test/test_ckeygen.py +=================================================================== +--- Twisted-20.3.0.orig/src/twisted/conch/test/test_ckeygen.py ++++ Twisted-20.3.0/src/twisted/conch/test/test_ckeygen.py +@@ -66,7 +66,7 @@ class KeyGenTests(TestCase): + + def _testrun(self, keyType, keySize=None, privateKeySubtype=None): + filename = self.mktemp() +- args = ['ckeygen', '-t', keyType, '-f', filename, '--no-passphrase'] ++ args = ['ckeygen-' + sys.version[:3], '-t', keyType, '-f', filename, '--no-passphrase'] + if keySize is not None: + args.extend(['-b', keySize]) + if privateKeySubtype is not None: +@@ -100,7 +100,7 @@ class KeyGenTests(TestCase): + def test_runBadKeytype(self): + filename = self.mktemp() + with self.assertRaises(subprocess.CalledProcessError): +- subprocess.check_call(['ckeygen', '-t', 'foo', '-f', filename]) ++ subprocess.check_call(['ckeygen-' + sys.version[:3], '-t', 'foo', '-f', filename]) + + +