summaryrefslogtreecommitdiff
path: root/dev-python/twisted
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/twisted')
-rw-r--r--dev-python/twisted/Manifest16
-rw-r--r--dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch41
-rw-r--r--dev-python/twisted/files/twisted-19.10.0-py38.patch110
-rw-r--r--dev-python/twisted/files/twisted-19.10.0-py39-b64.patch165
-rw-r--r--dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch259
-rw-r--r--dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch94
-rw-r--r--dev-python/twisted/files/twisted-20.3.0-py39-b64.patch158
-rw-r--r--dev-python/twisted/files/twisted-20.3.0-py39-combined.patch115
-rw-r--r--dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch67
-rw-r--r--dev-python/twisted/twisted-19.10.0.ebuild194
-rw-r--r--dev-python/twisted/twisted-21.2.0-r1.ebuild2
-rw-r--r--dev-python/twisted/twisted-21.7.0.ebuild (renamed from dev-python/twisted/twisted-20.3.0.ebuild)72
12 files changed, 99 insertions, 1194 deletions
diff --git a/dev-python/twisted/Manifest b/dev-python/twisted/Manifest
index 7485b613d57c..249f2a706a0b 100644
--- a/dev-python/twisted/Manifest
+++ b/dev-python/twisted/Manifest
@@ -1,20 +1,12 @@
AUX twistd.conf 277 BLAKE2B 78ca35b410a6597c9afe6a9c8d3dfb1de113411634901f936794e8a59c0644233d0673e710bd0870ecf4312d079c46f62f43928605700559134f1fb62490559a SHA512 76d44caebab8404f16937c2515ad9ae8236732a48c7127366f7fa22c6ed3d88ace2d33b832a6d95f775973d41b7caf75344805fe5b01e964c04eb710bf3c89fb
AUX twistd.init 563 BLAKE2B 24488118b025bf2068bbf07af900064ff6a7ee99106c3da30f15f2b3f85af7443212afebc6b52a12645488b85656f87b653df9263fc2be6bd09707917899f252 SHA512 7860601beba1efda2b0a045b2a044ec33caff9ee915d45225c05e281760a68da349b4c45080600177aab32aa806714327acf3cf5dda92be0874f781f129bb129
-AUX twisted-19.10.0-py38-cgi.patch 1356 BLAKE2B d172448bd2807dc57ac2a905427f0a91fa93dd17a1e58ab64dc17fc02fe05a81cee4c08aa667c799720cde33877e4b72f8db8df3587d8d8d711988bb2e388128 SHA512 65629acfc2f6dd6686db715024209e9ff12b97d5190c4377e6d88222c85c1d2a1f3502a93801525ee1a0fc0357f2b28ba87db888ea64bccfbfdc74fdfb667f42
-AUX twisted-19.10.0-py38.patch 3997 BLAKE2B 26df585019d5e2aca4257c9a7840a973ee9e1f3dfce65c76b021b8d6ea07ed8c6abca237c11ce75b49994ea7ed95de587a433a6a6f3577cd6f2ddf243d40defd SHA512 bc6eb1b1bbb704fe30c4ef071f8d8e95faaad3089013d11765f30f4b6bdbb108b913b043c071d00c18b53655841cb1810286331c5318d4659ad7c90d90b9fb4e
-AUX twisted-19.10.0-py39-b64.patch 7022 BLAKE2B f59573231a70318aac1f383602725949f033e017c036ab204815816ef168ad122253e903ff577c1a055c12023d06dc49ebfcdecf693d9890476785653860a628 SHA512 5904bcf5eadcd53d038870d6868fec1a81d6327c31b7b2360987a69e6f4046e92e11b52260c53a2361687161a36a5b6f53b24906d404ebe25f86e5bdc11fc6dc
-AUX twisted-20.3.0-py38-cgi.patch 8601 BLAKE2B 6eb76eaa1cfe10ba473a334bfd5e5a4c760739550c4aeba5cf68cbf380ca7f24725e102cf0f75b7a384faf639e03d9e80c11e0cc56339319329207a6342a8d55 SHA512 9877f4e3c0ad6d438cb046a04e60affbcbe7b263d06128ec6ea4d726194b044bf9f6c68891373624b435fb434fc878220834d038180d3d203defe31dab44710c
-AUX twisted-20.3.0-py38-hmac.patch 3484 BLAKE2B b89587da906517a621ba880eb6eb71cc2f397a7bcf7bcf065f79897626f821d965b2daa0d105af7e48c8c30fb79fb836c02db17058b5ac046ae92f9578899a62 SHA512 a6ed24994bf76a7e602144eed706c61cce531408db050dc2a497fb4131b5594f4d29ebd34c0d780b283460d130dfc88b19ad9cbe5436c0290b9b13eb35c9342b
-AUX twisted-20.3.0-py39-b64.patch 6747 BLAKE2B 1bb6960e5049f43b08e2ba7a56a16616e82f3b18290645b2f14bd15a199d3e1b2767e030a8295fc2d3f4a8a3d1a6e4a5d5d7d55a089da643c593b2a3df174119 SHA512 6f58dcecf07925d15a1373726e03da4083a0266ee6629089b30b0c8ab62bd007579942430989df2d550578067e2c2c542062dd20a38851794f6ef86e85aefb95
-AUX twisted-20.3.0-py39-combined.patch 3752 BLAKE2B 687698bccf6af3213812ae29e7e234c36941f0f7ecfdcfa8c14a6a7b5a433b9ff2a40c2ad870e46b3437210202cf0dc58e17c8d29ebf506c499780355cf60bdb SHA512 81f0b597a7b2609bae5f405388bccf759dd6b0295cf05e6ef2aee76d0f3ab4367a474704aab2753d101be2580d097f30d94acc529035bdb3c3ec43dd035fb733
AUX twisted-21.2.0-force-gtk3.patch 1619 BLAKE2B d167c6e3177a345c03e68d37d596e743af0eb5b7acbc055df032bba26b38acced190baa6b44b3ae8f750fa06d4670a5e85146b95508bfb9acb93980e5a0bdbf4 SHA512 3b359d98c747a3d10e5e16fd3de5f00eb56fa64bef7fdbac07f569ad49033c63092703584ff7127e6af8394fc1b4e94846a0556bd7db38b473a473e4d833f7db
AUX twisted-21.2.0-incremental-21.patch 2303 BLAKE2B 34bd2eef6b7bc9810466bb5daa97736eb8aba88ed6e9e1bec78a9547d7068a330685eacaaf8b5eb16a33733792a0bff8a78b08f5ff5c6766763e687a98e1295e SHA512 0f2aabc82233dd43a418de38d6b46284e5f7c136e27eaecd423d25908c9a652c7725ea0318bcbee906b2d3cdf8b9cdf44e4ee496ed33aad60f609a3980bbb115
AUX twisted-21.2.0-int-from-bytes.patch 485 BLAKE2B c436bcfdacc124a1f6d24d1a9500940e18efb2136dbd35f86575495ee1b4afb6ae4e0eaf262167c4d4dacdda28c8ec2b951fadd2570e9894d90f0bf09ddeee6a SHA512 3794ea978ebe82103aedf284a57215a69a68804d43f2def9dba58f600f8af190ae2fd6ddcc064ece35dec85661830eb386c1ce799aefb78f60e530fe23cdcb22
-DIST Twisted-19.10.0.tar.bz2 3118485 BLAKE2B a0d532b67177aa017e463bf823d7842d4f6ff694f78cd7600865718ffe861023a53ea6a922f7de232133edba26f5255074d7ef277ce8f3bdf02d556ccf4abf41 SHA512 de8d7fd0b2081cebeff68b060c8469377011648bc563a94a993d3530fb007ed42c3a54925c9a10c465ee7a3065cc9108ace12d10d358223fab13494becb9ac4b
-DIST Twisted-20.3.0.tar.bz2 3127793 BLAKE2B 2e85fc3ec26d89e563c9e79a5d2adea81ff1745d18f0f92b8d45ae3729fbddf09998664257880372c7a4caeb5977c5cad7c863596b8c27ad7890275cead9f763 SHA512 1b850e5fc21a3630ead4c2cc3622c16e78bb3be38ab11d021779b7ce3d3c30acc4e19d79c7791a5fce6c5c6e09c2baa349901dffe952de67dd98eec419846365
+AUX twisted-21.7.0-force-gtk3.patch 2759 BLAKE2B 65be4e948865a8de6cda3fbb9e90032d8c90b4db2e6b60d5861868273837c2ce846ab1452ca468f2e65be27882ca17ba842a9010607cc0e3969aeb70490e9ab1 SHA512 f4424f2b1f785c459263b4cdd3f906543e99ad6956130dcf3f6b589386a84637ca52d1346dc3465ef23fc82c701751e6053d145a0ca5225b846d6a7c20991f73
DIST twisted-21.2.0.tar.gz 3882978 BLAKE2B ba37572b0f9eadf2962a2730e4c2c0ed65f582b11b3350034660a2c53c5cd0892b19867d19e0201d4808c09fca621dbe540d153dc6c7d5827d45d2423d19d28b SHA512 fa743dcf22f3c17dfd17f39b7df0cc31fb8ce3e989478ada9a026424ec2de35e6a403ef35acdef5905eed008d42e3c2fee6b7ccdda433e6c250f1feaa83ea8a4
+DIST twisted-21.7.0.tar.gz 3895345 BLAKE2B 510165ad2933f07005e508df5a8bdf2863a7988c0f18fcc089e948d190c65aab32fc876d3120e311e91d6989f1ea2d8b3b5f5db4a9dfc63c38da56213f718728 SHA512 a946769a6bc6c72af26e7763b9e0675788f134b4d005ea89d935da1b1d5f60d92c84fdb2615e442e7da2b98291ee8a63d5236ec7ba72ef04ad3f847b092feecb
DIST twisted-regen-cache.gz 911 BLAKE2B ffd3fcda6c67ffe6fd3ef581c8d507548396b66ed0708e9a5c790095e579c0d5f0f71596acf05712989da2ddef2b8d437eca973bc4d80ef8a9fa852915f38305 SHA512 95a9b931c73017d16d1b5e6b41345dddffe62b6af1a8e93b5e40d06d3d15be17b0dd0181c767ffeeb791534d463764ef9e066fa6c2ee2ac4b53c86d1da8fce03
-EBUILD twisted-19.10.0.ebuild 5778 BLAKE2B 357cb440aa44c8203865c199b5d00d6da0567a19270065277eed1ecaf4e999d51120aa66db9200c0b18af64e2855cee4986de6e198504b72f9d691b0a541ab8b SHA512 8d0c15bd1fd4aab254053bca7b7b65066dca3ee8078af107dd5388d893ad6edfdb8abb7e89806314d1a755e65e1055c98354774ead50dc0cf64cbe4c5e6ddd99
-EBUILD twisted-20.3.0.ebuild 5612 BLAKE2B 7fec5be0b0ccf4cddcb2b04fdd3de6ce697f0fafec4e622cdc3d1761947f7c469b70e3e4bdb21262fa8645bbfdbeba8b2070723bcee97c02f8029734baa05c30 SHA512 4375f5549010300e6e933470c3be054289acf5e6cebb18189d8c1ba1e2aa9c96e8629c0b6c5fc3aa68218b84d978120be3e703dfec901f49cc75db0533a86e16
-EBUILD twisted-21.2.0-r1.ebuild 5160 BLAKE2B f86a801b1e5b995b821b4e5327ca4cd12f39a530e6251f3344ae24b6b798f2c6a44d28acf24873404b27e38b6d1792ae28a2bbe6b268c39a4004cf9f7322844a SHA512 c98f9376e32b044fc5718455ab1777a4f6347246b33ddd9b25c8f1cb665ce9cf6bc51c67042b08bca17d97eb950ec90eed95eaba0d5ff0dfb1c1aeea76b2fb95
+EBUILD twisted-21.2.0-r1.ebuild 5159 BLAKE2B 9a7bac0617c2416d67abd62716c0434111f6fad1eea367ad9ede428f12ecd09e2569202af6162861d7c4f7f2fd760f0eaa39e2fe87df10981f98f33b82a29d2a SHA512 f7d4a6f3ceabcf59154d4a56938315c5ac881b17474c251d947ecc7292661bf1ec42b82f59cfedbc1bbf6637918fe5748581a7912dfb20b29da59934349247a7
+EBUILD twisted-21.7.0.ebuild 4975 BLAKE2B 6d4d3ebf50e33a99ecd340b824235d86a74d377c655427b27dc826aadb80b1c33d5a4856717e3d6cb8588968bdbcb6fc7e6fd9be7d026b48ed7aa71b2cf9c0a9 SHA512 e8b85128c506ca63847a7eeffd3105fcf02d17290a4ea6205ce55bb0aee9160401b88ab085280f617dbae263b6294a4070fc8ef65d6a69c9c60f89c8c9e08bca
MISC metadata.xml 1351 BLAKE2B b3a4ccdc922dd4aa902b24b2545f3cc5517b2842c92f1195e8eaa2a8b62558c1ea86059cc23b9ad6a8e6093216a11a01f46360b5ba259e5eadcb351ad3bc0094 SHA512 403d692122913d079c5a93cb5b226f33316776360663a171cd757584d219d0789b24809c9e65840aaeb63eae4cb7cc79258757837abb1e3dd92536369fff6604
diff --git a/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch b/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
deleted file mode 100644
index 5fc4768e5d23..000000000000
--- a/dev-python/twisted/files/twisted-19.10.0-py38-cgi.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
-index 6001d1e40..1cf9172ef 100644
---- a/src/twisted/web/test/test_http.py
-+++ b/src/twisted/web/test/test_http.py
-@@ -9,15 +9,15 @@ from __future__ import absolute_import, division
-
- import base64
- import calendar
--import cgi
- import random
-
- import hamcrest
-
- try:
- from urlparse import urlparse, urlunsplit, clear_cache
-+ from cgi import parse_qs
- except ImportError:
-- from urllib.parse import urlparse, urlunsplit, clear_cache
-+ from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs
-
- from io import BytesIO
- from itertools import cycle
-@@ -2156,15 +2156,15 @@ Hello,
- class QueryArgumentsTests(unittest.TestCase):
- def testParseqs(self):
- self.assertEqual(
-- cgi.parse_qs(b"a=b&d=c;+=f"),
-+ parse_qs(b"a=b&d=c;+=f"),
- http.parse_qs(b"a=b&d=c;+=f"))
- self.assertRaises(
- ValueError, http.parse_qs, b"blah", strict_parsing=True)
- self.assertEqual(
-- cgi.parse_qs(b"a=&b=c", keep_blank_values=1),
-+ parse_qs(b"a=&b=c", keep_blank_values=1),
- http.parse_qs(b"a=&b=c", keep_blank_values=1))
- self.assertEqual(
-- cgi.parse_qs(b"a=&b=c"),
-+ parse_qs(b"a=&b=c"),
- http.parse_qs(b"a=&b=c"))
-
-
diff --git a/dev-python/twisted/files/twisted-19.10.0-py38.patch b/dev-python/twisted/files/twisted-19.10.0-py38.patch
deleted file mode 100644
index e787167d45b3..000000000000
--- a/dev-python/twisted/files/twisted-19.10.0-py38.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From d33b90880b8eb024daa73bc3fd39aca0bc791ff1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Lucas=20Treffenst=C3=A4dt?= <lucas@treffenstaedt.de>
-Date: Mon, 13 Jan 2020 13:54:08 +0100
-Subject: [PATCH 1/2] CramMD5ClientAuthenticator now specifies the digestmod
- argument to hmac.HMAC constructor explicitly.
-
----
- src/twisted/mail/_cred.py | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/twisted/mail/_cred.py b/src/twisted/mail/_cred.py
-index 9d3646948..43c406f90 100644
---- a/src/twisted/mail/_cred.py
-+++ b/src/twisted/mail/_cred.py
-@@ -8,6 +8,7 @@ Credential managers for L{twisted.mail}.
- from __future__ import absolute_import, division
-
- import hmac
-+import hashlib
-
- from zope.interface import implementer
-
-@@ -28,7 +29,7 @@ class CramMD5ClientAuthenticator:
-
-
- def challengeResponse(self, secret, chal):
-- response = hmac.HMAC(secret, chal).hexdigest().encode('ascii')
-+ response = hmac.HMAC(secret, chal, digestmod = hashlib.md5).hexdigest().encode('ascii')
- return self.user + b' ' + response
-
-
---
-2.26.2
-
-From 694bc67f3cf7d36a6f512f0b76882e85d0966dd2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Poisson?= <goffi@goffi.org>
-Date: Sun, 17 Nov 2019 19:48:53 +0100
-Subject: [PATCH 2/2] 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 | 17 +++++++++++++++++
- src/twisted/words/xish/domish.py | 11 +++++++++--
- 3 files changed, 27 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 000000000..5c91305c8
---- /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 a8f8fa76b..cd16e3a4d 100644
---- a/src/twisted/words/test/test_domish.py
-+++ b/src/twisted/words/test/test_domish.py
-@@ -350,6 +350,23 @@ class DomishStreamTestsMixin:
- self.elements[0].attributes, {(" bar baz ", "baz"): "quux"})
-
-
-+ def test_attributesWithNamespaces(self):
-+ """
-+ Attributes with namespace are parsed without Exception.
-+ (https://twistedmatrix.com/trac/ticket/9730 regression test)
-+ """
-+
-+ xml = b"""<root xmlns:test='http://example.org' xml:lang='en'>
-+ <test:test>test</test:test>
-+ </root>"""
-+
-+ # 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"<root xmlns='testns' xmlns:foo='testns2'><foo:child/></root>"
-
-diff --git a/src/twisted/words/xish/domish.py b/src/twisted/words/xish/domish.py
-index 2063c410a..fc49285f5 100644
---- a/src/twisted/words/xish/domish.py
-+++ b/src/twisted/words/xish/domish.py
-@@ -807,11 +807,18 @@ class ExpatElementStream:
- qname = ('', name)
-
- # Process attributes
-+ newAttrs = {}
-+ toDelete = []
- for k, v in attrs.items():
- if " " in k:
- aqname = k.rsplit(" ", 1)
-- attrs[(aqname[0], aqname[1])] = v
-- del attrs[k]
-+ newAttrs[(aqname[0], aqname[1])] = v
-+ toDelete.append(k)
-+
-+ attrs.update(newAttrs)
-+
-+ for k in toDelete:
-+ del attrs[k]
-
- # Construct the new element
- e = Element(qname, self.defaultNsStack[-1], attrs, self.localPrefixes)
---
-2.26.2
-
diff --git a/dev-python/twisted/files/twisted-19.10.0-py39-b64.patch b/dev-python/twisted/files/twisted-19.10.0-py39-b64.patch
deleted file mode 100644
index f67d6240558a..000000000000
--- a/dev-python/twisted/files/twisted-19.10.0-py39-b64.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-From f56133a2e0d7ddf9ee6e43bf9e1d62e970cb0b3a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 27 May 2020 13:23:37 +0200
-Subject: [PATCH] Replace base64.*string() functions to fix py3.9 support
-
-Replace base64.decodestring() and .encodestring() functions as they
-were deprecated since Python 3.1 in favor of (equivalent) .decodebytes()
-and .encodebytes(), and were eventually removed in Python 3.9.
-
-While at it, replace most of their uses with base64.b64encode()
-and .b64decode() that are preferable to the former wrt ticket #6446,
-and they do not introduce line breaks that the twisted code usually
-discarded.
-
-Use .decodebytes() and .encodebytes() in DirDBM as it seems to rely
-on the exact presence of newlines, and changing that would break
-backwards compatibility.
-
-Fixes: ticket:6446
-Fixes: ticket:9831
----
- src/twisted/conch/scripts/tkconch.py | 2 +-
- src/twisted/conch/test/test_keys.py | 2 +-
- src/twisted/mail/pop3.py | 4 ++--
- src/twisted/mail/test/test_pop3.py | 4 ++--
- src/twisted/persisted/dirdbm.py | 10 ++++++++--
- src/twisted/web/http.py | 2 +-
- src/twisted/web/test/test_http.py | 6 +++---
- 14 files changed, 18 insertions(+), 12 deletions(-)
-
-diff --git a/src/twisted/conch/scripts/tkconch.py b/src/twisted/conch/scripts/tkconch.py
-index 9c48e8a7f..5e007ebdc 100644
---- a/src/twisted/conch/scripts/tkconch.py
-+++ b/src/twisted/conch/scripts/tkconch.py
-@@ -409,7 +409,7 @@ class SSHClientTransport(transport.SSHClientTransport):
- "known hosts.\r\n" %
- (khHost, {b'ssh-dss':'DSA', b'ssh-rsa':'RSA'}[keyType]))
- with open(os.path.expanduser('~/.ssh/known_hosts'), 'a') as known_hosts:
-- encodedKey = base64.encodestring(pubKey).replace(b'\n', b'')
-+ encodedKey = base64.b64encode(pubKey)
- known_hosts.write('\n%s %s %s' % (khHost, keyType, encodedKey))
- except:
- log.deferr()
-diff --git a/src/twisted/conch/test/test_keys.py b/src/twisted/conch/test/test_keys.py
-index 41e49f415..795e7b8d7 100644
---- a/src/twisted/conch/test/test_keys.py
-+++ b/src/twisted/conch/test/test_keys.py
-@@ -352,7 +352,7 @@ SUrCyZXsNh6VXwjs3gKQ
-
- self.assertRaises(
- keys.BadKeyError,
-- keys.Key.fromString, data=b'{' + base64.encodestring(sexp) + b'}',
-+ keys.Key.fromString, data=b'{' + base64.b64encode(sexp) + b'}',
- )
-
-
-diff --git a/src/twisted/mail/pop3.py b/src/twisted/mail/pop3.py
-index ffe9714c9..057389e3a 100644
---- a/src/twisted/mail/pop3.py
-+++ b/src/twisted/mail/pop3.py
-@@ -728,7 +728,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
- self._auth = auth()
- chal = self._auth.getChallenge()
-
-- self.sendLine(b'+ ' + base64.encodestring(chal).rstrip(b'\n'))
-+ self.sendLine(b'+ ' + base64.b64encode(chal))
- self.state = 'AUTH'
-
-
-@@ -747,7 +747,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
- """
- self.state = "COMMAND"
- try:
-- parts = base64.decodestring(line).split(None, 1)
-+ parts = base64.b64decode(line).split(None, 1)
- except binascii.Error:
- self.failResponse(b"Invalid BASE64 encoding")
- else:
-diff --git a/src/twisted/mail/test/test_pop3.py b/src/twisted/mail/test/test_pop3.py
-index ea513487c..36780d9c9 100644
---- a/src/twisted/mail/test/test_pop3.py
-+++ b/src/twisted/mail/test/test_pop3.py
-@@ -1097,12 +1097,12 @@ class SASLTests(unittest.TestCase):
-
- p.lineReceived(b"AUTH CRAM-MD5")
- chal = s.getvalue().splitlines()[-1][2:]
-- chal = base64.decodestring(chal)
-+ chal = base64.b64decode(chal)
- response = hmac.HMAC(b'testpassword', chal,
- digestmod=md5).hexdigest().encode("ascii")
-
- p.lineReceived(
-- base64.encodestring(b'testuser ' + response).rstrip(b'\n'))
-+ base64.b64encode(b'testuser ' + response))
- self.assertTrue(p.mbox)
- self.assertTrue(s.getvalue().splitlines()[-1].find(b"+OK") >= 0)
- p.connectionLost(failure.Failure(Exception("Test harness disconnect")))
-diff --git a/src/twisted/persisted/dirdbm.py b/src/twisted/persisted/dirdbm.py
-index f97c526d0..d9f29cce2 100644
---- a/src/twisted/persisted/dirdbm.py
-+++ b/src/twisted/persisted/dirdbm.py
-@@ -81,14 +81,20 @@ class DirDBM:
- Encode a key so it can be used as a filename.
- """
- # NOTE: '_' is NOT in the base64 alphabet!
-- return base64.encodestring(k).replace(b'\n', b'_').replace(b"/", b"-")
-+ try:
-+ return base64.encodebytes(k).replace(b'\n', b'_').replace(b"/", b"-")
-+ except AttributeError:
-+ return base64.encodestring(k).replace(b'\n', b'_').replace(b"/", b"-")
-
-
- def _decode(self, k):
- """
- Decode a filename to get the key.
- """
-- return base64.decodestring(k.replace(b'_', b'\n').replace(b"-", b"/"))
-+ try:
-+ return base64.decodebytes(k.replace(b'_', b'\n').replace(b"-", b"/"))
-+ except AttributeError:
-+ return base64.decodestring(k.replace(b'_', b'\n').replace(b"-", b"/"))
-
-
- def _readFile(self, path):
-diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py
-index fe88d3373..602a58f31 100644
---- a/src/twisted/web/http.py
-+++ b/src/twisted/web/http.py
-@@ -1540,7 +1540,7 @@ class Request:
- bas, upw = authh.split()
- if bas.lower() != b"basic":
- raise ValueError()
-- upw = base64.decodestring(upw)
-+ upw = base64.b64decode(upw)
- self.user, self.password = upw.split(b':', 1)
- except (binascii.Error, ValueError):
- self.user = self.password = ""
-diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
-index 6001d1e40..70065e232 100644
---- a/src/twisted/web/test/test_http.py
-+++ b/src/twisted/web/test/test_http.py
-@@ -1513,7 +1513,7 @@ class ParsingTests(unittest.TestCase):
- requests.append(self)
-
- for u, p in [(b"foo", b"bar"), (b"hello", b"there:z")]:
-- s = base64.encodestring(b":".join((u, p))).strip()
-+ s = base64.b64encode(b":".join((u, p)))
- f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
- self.runRequest(f, Request, 0)
- req = requests.pop()
-@@ -2139,9 +2139,9 @@ Hello,
-
- u = b"foo"
- p = b"bar"
-- s = base64.encodestring(b":".join((u, p))).strip()
-+ s = base64.b64encode(b":".join((u, p)))
- f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
-- self.patch(base64, 'decodestring', lambda x: [])
-+ self.patch(base64, 'b64decode', lambda x: [])
- self.runRequest(f, Request, 0)
- req = requests.pop()
- self.assertEqual(('', ''), req.credentials)
---
-2.26.2
-
diff --git a/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch b/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch
deleted file mode 100644
index 5151f297f7f4..000000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py38-cgi.patch
+++ /dev/null
@@ -1,259 +0,0 @@
-From 62ab0203c59c1f9788c53dfad4a212774094d05c Mon Sep 17 00:00:00 2001
-From: Craig Rodrigues <rodrigc@FreeBSD.org>
-Date: Mon, 13 Apr 2020 01:22:23 -0700
-Subject: [PATCH 2/2] Merge 9801-rodrigc-cgi: Change import of cgi.parse_qs to
- urllib.parse.parse_qs
-
-Author: rodrigc
-Reviewer: hawkowl
-Fixes: ticket:9801
----
- src/twisted/web/client.py | 17 ++++-----
- src/twisted/web/http.py | 49 ++++++++++++-------------
- src/twisted/web/newsfragments/9801.misc | 0
- src/twisted/web/test/test_http.py | 41 +++------------------
- src/twisted/web/test/test_webclient.py | 5 +--
- 5 files changed, 38 insertions(+), 74 deletions(-)
- create mode 100644 src/twisted/web/newsfragments/9801.misc
-
-diff --git a/src/twisted/web/client.py b/src/twisted/web/client.py
-index 7e4642ef3..8209f5a5e 100644
---- a/src/twisted/web/client.py
-+++ b/src/twisted/web/client.py
-@@ -12,15 +12,8 @@ import os
- import collections
- import warnings
-
--try:
-- from urlparse import urlunparse, urljoin, urldefrag
--except ImportError:
-- from urllib.parse import urljoin, urldefrag
-- from urllib.parse import urlunparse as _urlunparse
--
-- def urlunparse(parts):
-- result = _urlunparse(tuple([p.decode("charmap") for p in parts]))
-- return result.encode("charmap")
-+from urllib.parse import urljoin, urldefrag
-+from urllib.parse import urlunparse as _urlunparse
-
- import zlib
- from functools import wraps
-@@ -51,6 +44,12 @@ from twisted.web._newclient import _ensureValidURI, _ensureValidMethod
-
-
-
-+def urlunparse(parts):
-+ result = _urlunparse(tuple([p.decode("charmap") for p in parts]))
-+ return result.encode("charmap")
-+
-+
-+
- class PartialDownloadError(error.Error):
- """
- Page was only partially downloaded, we got disconnected in middle.
-diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py
-index b7afa8b0d..94d0ae81f 100644
---- a/src/twisted/web/http.py
-+++ b/src/twisted/web/http.py
-@@ -66,27 +66,10 @@ import time
- import calendar
- import warnings
- import os
--from io import BytesIO as StringIO
--
--try:
-- from urlparse import (
-- ParseResult as ParseResultBytes, urlparse as _urlparse)
-- from urllib import unquote
-- from cgi import parse_header as _parseHeader
--except ImportError:
-- from urllib.parse import (
-- ParseResultBytes, urlparse as _urlparse, unquote_to_bytes as unquote)
--
-- def _parseHeader(line):
-- # cgi.parse_header requires a str
-- key, pdict = cgi.parse_header(line.decode('charmap'))
--
-- # We want the key as bytes, and cgi.parse_multipart (which consumes
-- # pdict) expects a dict of str keys but bytes values
-- key = key.encode('charmap')
-- pdict = {x:y.encode('charmap') for x, y in pdict.items()}
-- return (key, pdict)
-+from io import BytesIO
-
-+from urllib.parse import (
-+ ParseResultBytes, urlparse as _urlparse, unquote_to_bytes as unquote)
-
- from zope.interface import Attribute, Interface, implementer, provider
-
-@@ -163,6 +146,20 @@ monthname = [None,
- weekdayname_lower = [name.lower() for name in weekdayname]
- monthname_lower = [name and name.lower() for name in monthname]
-
-+
-+
-+def _parseHeader(line):
-+ # cgi.parse_header requires a str
-+ key, pdict = cgi.parse_header(line.decode('charmap'))
-+
-+ # We want the key as bytes, and cgi.parse_multipart (which consumes
-+ # pdict) expects a dict of str keys but bytes values
-+ key = key.encode('charmap')
-+ pdict = {x: y.encode('charmap') for x, y in pdict.items()}
-+ return (key, pdict)
-+
-+
-+
- def urlparse(url):
- """
- Parse an URL into six components.
-@@ -486,13 +483,15 @@ class _IDeprecatedHTTPChannelToRequestInterface(Interface):
-
- class StringTransport:
- """
-- I am a StringIO wrapper that conforms for the transport API. I support
-+ I am a BytesIO wrapper that conforms for the transport API. I support
- the `writeSequence' method.
- """
- def __init__(self):
-- self.s = StringIO()
-+ self.s = BytesIO()
-+
- def writeSequence(self, seq):
- self.s.write(b''.join(seq))
-+
- def __getattr__(self, attr):
- return getattr(self.__dict__['s'], attr)
-
-@@ -513,7 +512,7 @@ class HTTPClient(basic.LineReceiver):
- @type firstLine: C{bool}
-
- @ivar __buffer: The buffer that stores the response to the HTTP request.
-- @type __buffer: A C{StringIO} object.
-+ @type __buffer: A C{BytesIO} object.
-
- @ivar _header: Part or all of an HTTP request header.
- @type _header: C{bytes}
-@@ -579,7 +578,7 @@ class HTTPClient(basic.LineReceiver):
- if self._header != b"":
- # Only extract headers if there are any
- self.extractHeader(self._header)
-- self.__buffer = StringIO()
-+ self.__buffer = BytesIO()
- self.handleEndHeaders()
- self.setRawMode()
- return
-@@ -665,7 +664,7 @@ def _getContentFile(length):
- Get a writeable file-like object to which request content can be written.
- """
- if length is not None and length < 100000:
-- return StringIO()
-+ return BytesIO()
- return tempfile.TemporaryFile()
-
-
-diff --git a/src/twisted/web/newsfragments/9801.misc b/src/twisted/web/newsfragments/9801.misc
-new file mode 100644
-index 000000000..e69de29bb
-diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
-index a3067f732..4189b307c 100644
---- a/src/twisted/web/test/test_http.py
-+++ b/src/twisted/web/test/test_http.py
-@@ -9,15 +9,11 @@ from __future__ import absolute_import, division
-
- import base64
- import calendar
--import cgi
- import random
-
- import hamcrest
-
--try:
-- from urlparse import urlparse, urlunsplit, clear_cache
--except ImportError:
-- from urllib.parse import urlparse, urlunsplit, clear_cache
-+from urllib.parse import urlparse, urlunsplit, clear_cache, parse_qs
-
- from io import BytesIO
- from itertools import cycle
-@@ -28,7 +24,7 @@ from zope.interface import (
- )
- from zope.interface.verify import verifyObject
-
--from twisted.python.compat import (_PY3, iterbytes, long, networkString,
-+from twisted.python.compat import (iterbytes, long, networkString,
- unicode, intToBytes)
- from twisted.python.components import proxyForInterface
- from twisted.python.failure import Failure
-@@ -2019,33 +2015,6 @@ Content-Type: application/x-www-form-urlencoded
- self.assertEqual(content, [networkString(query)])
-
-
-- def test_missingContentDisposition(self):
-- """
-- If the C{Content-Disposition} header is missing, the request is denied
-- as a bad request.
-- """
-- req = b'''\
--POST / HTTP/1.0
--Content-Type: multipart/form-data; boundary=AaB03x
--Content-Length: 103
--
----AaB03x
--Content-Type: text/plain
--Content-Transfer-Encoding: quoted-printable
--
--abasdfg
----AaB03x--
--'''
-- channel = self.runRequest(req, http.Request, success=False)
-- self.assertEqual(
-- channel.transport.value(),
-- b"HTTP/1.1 400 Bad Request\r\n\r\n")
--
-- if _PY3:
-- test_missingContentDisposition.skip = (
-- "cgi.parse_multipart is much more error-tolerant on Python 3.")
--
--
- def test_multipartProcessingFailure(self):
- """
- When the multipart processing fails the client gets a 400 Bad Request.
-@@ -2373,15 +2342,15 @@ ok
- class QueryArgumentsTests(unittest.TestCase):
- def testParseqs(self):
- self.assertEqual(
-- cgi.parse_qs(b"a=b&d=c;+=f"),
-+ parse_qs(b"a=b&d=c;+=f"),
- http.parse_qs(b"a=b&d=c;+=f"))
- self.assertRaises(
- ValueError, http.parse_qs, b"blah", strict_parsing=True)
- self.assertEqual(
-- cgi.parse_qs(b"a=&b=c", keep_blank_values=1),
-+ parse_qs(b"a=&b=c", keep_blank_values=1),
- http.parse_qs(b"a=&b=c", keep_blank_values=1))
- self.assertEqual(
-- cgi.parse_qs(b"a=&b=c"),
-+ parse_qs(b"a=&b=c"),
- http.parse_qs(b"a=&b=c"))
-
-
-diff --git a/src/twisted/web/test/test_webclient.py b/src/twisted/web/test/test_webclient.py
-index 680e02780..672594993 100644
---- a/src/twisted/web/test/test_webclient.py
-+++ b/src/twisted/web/test/test_webclient.py
-@@ -11,10 +11,7 @@ import io
- import os
- from errno import ENOSPC
-
--try:
-- from urlparse import urlparse, urljoin
--except ImportError:
-- from urllib.parse import urlparse, urljoin
-+from urllib.parse import urlparse, urljoin
-
- from twisted.python.compat import networkString, nativeString, intToBytes
- from twisted.trial import unittest, util
---
-2.26.2
-
diff --git a/dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch b/dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch
deleted file mode 100644
index 1c1ee01b2187..000000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py38-hmac.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 653fb2aea0ca1f60558917d52f4ff0c33cd7b067 Mon Sep 17 00:00:00 2001
-From: Craig Rodrigues <rodrigc@crodrigues.org>
-Date: Sun, 12 Apr 2020 14:28:23 -0700
-Subject: [PATCH 1/2] Add digestmod parameter to HMAC.__init__() invocations
-
-This parameter is now required on Python 3.8+
----
- src/twisted/cred/credentials.py | 3 ++-
- src/twisted/cred/test/test_cramauth.py | 11 ++++++++---
- src/twisted/mail/test/test_pop3.py | 4 +++-
- 3 files changed, 13 insertions(+), 5 deletions(-)
-
-diff --git a/src/twisted/cred/credentials.py b/src/twisted/cred/credentials.py
-index 5469e5158..67c24cb01 100644
---- a/src/twisted/cred/credentials.py
-+++ b/src/twisted/cred/credentials.py
-@@ -441,7 +441,8 @@ class CramMD5Credentials(object):
-
-
- def checkPassword(self, password):
-- verify = hexlify(hmac.HMAC(password, self.challenge).digest())
-+ verify = hexlify(hmac.HMAC(password, self.challenge,
-+ digestmod=md5).digest())
- return verify == self.response
-
-
-diff --git a/src/twisted/cred/test/test_cramauth.py b/src/twisted/cred/test/test_cramauth.py
-index 1ee08712b..d21f2f68c 100644
---- a/src/twisted/cred/test/test_cramauth.py
-+++ b/src/twisted/cred/test/test_cramauth.py
-@@ -7,6 +7,8 @@ Tests for L{twisted.cred}'s implementation of CRAM-MD5.
-
- from __future__ import division, absolute_import
-
-+import hashlib
-+
- from hmac import HMAC
- from binascii import hexlify
-
-@@ -39,7 +41,8 @@ class CramMD5CredentialsTests(TestCase):
- """
- c = CramMD5Credentials()
- chal = c.getChallenge()
-- c.response = hexlify(HMAC(b'secret', chal).digest())
-+ c.response = hexlify(HMAC(b'secret', chal,
-+ digestmod=hashlib.md5).digest())
- self.assertTrue(c.checkPassword(b'secret'))
-
-
-@@ -61,7 +64,8 @@ class CramMD5CredentialsTests(TestCase):
- """
- c = CramMD5Credentials()
- chal = c.getChallenge()
-- c.response = hexlify(HMAC(b'thewrongsecret', chal).digest())
-+ c.response = hexlify(HMAC(b'thewrongsecret', chal,
-+ digestmod=hashlib.md5).digest())
- self.assertFalse(c.checkPassword(b'secret'))
-
-
-@@ -75,7 +79,8 @@ class CramMD5CredentialsTests(TestCase):
- chal = c.getChallenge()
- c.setResponse(b" ".join(
- (b"squirrel",
-- hexlify(HMAC(b'supersecret', chal).digest()))))
-+ hexlify(HMAC(b'supersecret', chal,
-+ digestmod=hashlib.md5).digest()))))
- self.assertTrue(c.checkPassword(b'supersecret'))
- self.assertEqual(c.username, b"squirrel")
-
-diff --git a/src/twisted/mail/test/test_pop3.py b/src/twisted/mail/test/test_pop3.py
-index 4a59c3b49..ea513487c 100644
---- a/src/twisted/mail/test/test_pop3.py
-+++ b/src/twisted/mail/test/test_pop3.py
-@@ -11,6 +11,7 @@ import hmac
- import base64
- import itertools
-
-+from hashlib import md5
- from collections import OrderedDict
- from io import BytesIO
-
-@@ -1097,7 +1098,8 @@ class SASLTests(unittest.TestCase):
- p.lineReceived(b"AUTH CRAM-MD5")
- chal = s.getvalue().splitlines()[-1][2:]
- chal = base64.decodestring(chal)
-- response = hmac.HMAC(b'testpassword', chal).hexdigest().encode("ascii")
-+ response = hmac.HMAC(b'testpassword', chal,
-+ digestmod=md5).hexdigest().encode("ascii")
-
- p.lineReceived(
- base64.encodestring(b'testuser ' + response).rstrip(b'\n'))
---
-2.26.2
-
diff --git a/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch b/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch
deleted file mode 100644
index f475614df408..000000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py39-b64.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From f44c2ff111a8961d295409186cc07aaf414c76bc Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 27 May 2020 13:23:37 +0200
-Subject: [PATCH 1/4] Replace base64.*string() functions to fix py3.9 support
-
-Replace base64.decodestring() and .encodestring() functions as they
-were deprecated since Python 3.1 in favor of (equivalent) .decodebytes()
-and .encodebytes(), and were eventually removed in Python 3.9.
-
-While at it, replace most of their uses with base64.b64encode()
-and .b64decode() that are preferable to the former wrt ticket #6446,
-and they do not introduce line breaks that the twisted code usually
-discarded.
-
-Use .decodebytes() and .encodebytes() in DirDBM as it seems to rely
-on the exact presence of newlines, and changing that would break
-backwards compatibility.
-
-Fixes: ticket:6446
-Fixes: ticket:9831
----
- src/twisted/conch/scripts/tkconch.py | 2 +-
- src/twisted/conch/test/test_keys.py | 2 +-
- src/twisted/mail/pop3.py | 4 ++--
- src/twisted/mail/test/test_pop3.py | 4 ++--
- src/twisted/persisted/dirdbm.py | 4 ++--
- src/twisted/web/http.py | 2 +-
- src/twisted/web/test/test_http.py | 6 +++---
- 14 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/src/twisted/conch/scripts/tkconch.py b/src/twisted/conch/scripts/tkconch.py
-index a662cabc8..744734343 100644
---- a/src/twisted/conch/scripts/tkconch.py
-+++ b/src/twisted/conch/scripts/tkconch.py
-@@ -412,7 +412,7 @@ class SSHClientTransport(transport.SSHClientTransport):
- "known hosts.\r\n" %
- (khHost, {b'ssh-dss':'DSA', b'ssh-rsa':'RSA'}[keyType]))
- with open(os.path.expanduser('~/.ssh/known_hosts'), 'a') as known_hosts:
-- encodedKey = base64.encodestring(pubKey).replace(b'\n', b'')
-+ encodedKey = base64.b64encode(pubKey)
- known_hosts.write('\n%s %s %s' % (khHost, keyType, encodedKey))
- except:
- log.deferr()
-diff --git a/src/twisted/conch/test/test_keys.py b/src/twisted/conch/test/test_keys.py
-index 650a19bfb..f76cbd1b4 100644
---- a/src/twisted/conch/test/test_keys.py
-+++ b/src/twisted/conch/test/test_keys.py
-@@ -404,7 +404,7 @@ SUrCyZXsNh6VXwjs3gKQ
-
- self.assertRaises(
- keys.BadKeyError,
-- keys.Key.fromString, data=b'{' + base64.encodestring(sexp) + b'}',
-+ keys.Key.fromString, data=b'{' + base64.b64encode(sexp) + b'}',
- )
-
-
-diff --git a/src/twisted/mail/pop3.py b/src/twisted/mail/pop3.py
-index ffe9714c9..057389e3a 100644
---- a/src/twisted/mail/pop3.py
-+++ b/src/twisted/mail/pop3.py
-@@ -728,7 +728,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
- self._auth = auth()
- chal = self._auth.getChallenge()
-
-- self.sendLine(b'+ ' + base64.encodestring(chal).rstrip(b'\n'))
-+ self.sendLine(b'+ ' + base64.b64encode(chal))
- self.state = 'AUTH'
-
-
-@@ -747,7 +747,7 @@ class POP3(basic.LineOnlyReceiver, policies.TimeoutMixin):
- """
- self.state = "COMMAND"
- try:
-- parts = base64.decodestring(line).split(None, 1)
-+ parts = base64.b64decode(line).split(None, 1)
- except binascii.Error:
- self.failResponse(b"Invalid BASE64 encoding")
- else:
-diff --git a/src/twisted/mail/test/test_pop3.py b/src/twisted/mail/test/test_pop3.py
-index f7fbfaf1e..af335ab2d 100644
---- a/src/twisted/mail/test/test_pop3.py
-+++ b/src/twisted/mail/test/test_pop3.py
-@@ -1096,12 +1096,12 @@ class SASLTests(unittest.TestCase):
-
- p.lineReceived(b"AUTH CRAM-MD5")
- chal = s.getvalue().splitlines()[-1][2:]
-- chal = base64.decodestring(chal)
-+ chal = base64.b64decode(chal)
- response = hmac.HMAC(b'testpassword', chal,
- digestmod=md5).hexdigest().encode("ascii")
-
- p.lineReceived(
-- base64.encodestring(b'testuser ' + response).rstrip(b'\n'))
-+ base64.b64encode(b'testuser ' + response))
- self.assertTrue(p.mbox)
- self.assertTrue(s.getvalue().splitlines()[-1].find(b"+OK") >= 0)
- p.connectionLost(failure.Failure(Exception("Test harness disconnect")))
-diff --git a/src/twisted/persisted/dirdbm.py b/src/twisted/persisted/dirdbm.py
-index 3ba7a59d4..7659ff765 100644
---- a/src/twisted/persisted/dirdbm.py
-+++ b/src/twisted/persisted/dirdbm.py
-@@ -77,14 +77,14 @@ class DirDBM:
- Encode a key so it can be used as a filename.
- """
- # NOTE: '_' is NOT in the base64 alphabet!
-- return base64.encodestring(k).replace(b'\n', b'_').replace(b"/", b"-")
-+ return base64.encodebytes(k).replace(b'\n', b'_').replace(b"/", b"-")
-
-
- def _decode(self, k):
- """
- Decode a filename to get the key.
- """
-- return base64.decodestring(k.replace(b'_', b'\n').replace(b"-", b"/"))
-+ return base64.decodebytes(k.replace(b'_', b'\n').replace(b"-", b"/"))
-
-
- def _readFile(self, path):
-diff --git a/src/twisted/web/http.py b/src/twisted/web/http.py
-index 0e115741e..e9a080d21 100644
---- a/src/twisted/web/http.py
-+++ b/src/twisted/web/http.py
-@@ -1544,7 +1544,7 @@ class Request:
- bas, upw = authh.split()
- if bas.lower() != b"basic":
- raise ValueError()
-- upw = base64.decodestring(upw)
-+ upw = base64.b64decode(upw)
- self.user, self.password = upw.split(b':', 1)
- except (binascii.Error, ValueError):
- self.user = self.password = b''
-diff --git a/src/twisted/web/test/test_http.py b/src/twisted/web/test/test_http.py
-index 112e56f46..02a4674a7 100644
---- a/src/twisted/web/test/test_http.py
-+++ b/src/twisted/web/test/test_http.py
-@@ -1604,7 +1604,7 @@ class ParsingTests(unittest.TestCase):
- requests.append(self)
-
- for u, p in [(b"foo", b"bar"), (b"hello", b"there:z")]:
-- s = base64.encodestring(b":".join((u, p))).strip()
-+ s = base64.b64encode(b":".join((u, p)))
- f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
- self.runRequest(f, Request, 0)
- req = requests.pop()
-@@ -2209,9 +2209,9 @@ Hello,
-
- u = b"foo"
- p = b"bar"
-- s = base64.encodestring(b":".join((u, p))).strip()
-+ s = base64.b64encode(b":".join((u, p)))
- f = b"GET / HTTP/1.0\nAuthorization: Basic " + s + b"\n\n"
-- self.patch(base64, 'decodestring', lambda x: [])
-+ self.patch(base64, 'b64decode', lambda x: [])
- self.runRequest(f, Request, 0)
- req = requests.pop()
- self.assertEqual((b'', b''), req.credentials)
---
-2.26.2
diff --git a/dev-python/twisted/files/twisted-20.3.0-py39-combined.patch b/dev-python/twisted/files/twisted-20.3.0-py39-combined.patch
deleted file mode 100644
index 0ed1f7b8d9c6..000000000000
--- a/dev-python/twisted/files/twisted-20.3.0-py39-combined.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 2d30860a8b71e90513ead9958f5dd312802b0d36 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 27 May 2020 14:40:53 +0200
-Subject: [PATCH 2/4] Fix imap4-utf-7 codec lookup function for Python 3.9
-
-Python 3.9 normalizes the codec name into 'imap4_utf_7' rather than
-'imap4-utf-7', and therefore the lookup function needs to account
-for the former name. Transform the latter locally to preserve support
-for all Python versions.
-
-Fixes: ticket: 9832
----
- src/twisted/mail/imap4.py | 2 +-
- 2 files changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/twisted/mail/imap4.py b/src/twisted/mail/imap4.py
-index 736ef111d..3f32982ca 100644
---- a/src/twisted/mail/imap4.py
-+++ b/src/twisted/mail/imap4.py
-@@ -6369,7 +6369,7 @@ _codecInfo = codecs.CodecInfo(encoder, decoder, StreamReader, StreamWriter)
-
-
- def imap4_utf_7(name):
-- if name == 'imap4-utf-7':
-+ if name.replace('-', '_') == 'imap4_utf_7':
- return _codecInfo
-
- codecs.register(imap4_utf_7)
---
-2.26.2
-
-From daf928bf0f0371816dddbd4929948c4213d0cdcb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 27 May 2020 15:12:54 +0200
-Subject: [PATCH 3/4] Fix verifyCryptedPassword() for crypt.crypt() throwing in
- py3.9
-
-In Python 3.9, the crypt.crypt() function may throw an exception
-if the underlying crypt() function fails. Update
-verifyCryptedPassword() to account for that, and preserve the existing
-behavior of returning False in that case.
-
-Fixes: ticket:9833
----
- src/twisted/conch/checkers.py | 5 ++++-
- src/twisted/plugins/cred_unix.py | 5 ++++-
- 4 files changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/src/twisted/conch/checkers.py b/src/twisted/conch/checkers.py
-index 917567a39..e4e327b16 100644
---- a/src/twisted/conch/checkers.py
-+++ b/src/twisted/conch/checkers.py
-@@ -53,7 +53,10 @@ def verifyCryptedPassword(crypted, pw):
-
- @rtype: L{bool}
- """
-- return crypt.crypt(pw, crypted) == crypted
-+ try:
-+ return crypt.crypt(pw, crypted) == crypted
-+ except OSError:
-+ return False
-
-
-
-diff --git a/src/twisted/plugins/cred_unix.py b/src/twisted/plugins/cred_unix.py
-index 211b4ccbc..a662719b6 100644
---- a/src/twisted/plugins/cred_unix.py
-+++ b/src/twisted/plugins/cred_unix.py
-@@ -43,7 +43,10 @@ def verifyCryptedPassword(crypted, pw):
- pw = pw.decode('utf-8')
- if not isinstance(crypted, StringType):
- crypted = crypted.decode('utf-8')
-- return crypt.crypt(pw, crypted) == crypted
-+ try:
-+ return crypt.crypt(pw, crypted) == crypted
-+ except OSError:
-+ return False
-
-
-
---
-2.26.2
-
-From 4fc435df0d1eba3e5d6416a2b86d39d3404f82fe Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Wed, 27 May 2020 15:37:10 +0200
-Subject: [PATCH 4/4] Use xml.etree.ElementTree instead of deprecated
- cElementTree
-
-The xml.etree.cElementTree is deprecated, and has been removed in Python
-3.9. At the same time, xml.etree.ElementTree has already been using
-cElementTree implicitly since Python 3.3. Update test_flatten to use
-the latter to provide compatibility with newer Python versions.
-
-Fixes: ticket:9834
----
- src/twisted/web/test/test_flatten.py | 2 +-
- 2 files changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/twisted/web/test/test_flatten.py b/src/twisted/web/test/test_flatten.py
-index 677401c55..61d50e20a 100644
---- a/src/twisted/web/test/test_flatten.py
-+++ b/src/twisted/web/test/test_flatten.py
-@@ -9,7 +9,7 @@ L{twisted.web._flatten}.
- import sys
- import traceback
-
--from xml.etree.cElementTree import XML
-+from xml.etree.ElementTree import XML
-
- from collections import OrderedDict
-
---
-2.26.2
-
diff --git a/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch b/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch
new file mode 100644
index 000000000000..a2e40559ec59
--- /dev/null
+++ b/dev-python/twisted/files/twisted-21.7.0-force-gtk3.patch
@@ -0,0 +1,67 @@
+From eec6b60116e12e015387fe1fa3a729553d3848bf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 22 May 2021 01:11:48 +0200
+Subject: [PATCH] Force using GTK+3 in twisted.internet.gireactor
+
+Modify twisted.internet.gireactor to explicitly request GTK+ version 3.
+Otherwise it uses the newest version installed which could be GTK+4
+that gireactor is currently incompatible with.
+---
+ src/twisted/internet/gireactor.py | 3 +++
+ src/twisted/internet/test/test_gireactor.py | 3 +++
+ src/twisted/newsfragments/10200.bugfix | 1 +
+ 3 files changed, 7 insertions(+)
+ create mode 100644 src/twisted/newsfragments/10200.bugfix
+
+diff --git a/src/twisted/internet/gireactor.py b/src/twisted/internet/gireactor.py
+index 92596db1d..a577825a8 100644
+--- a/src/twisted/internet/gireactor.py
++++ b/src/twisted/internet/gireactor.py
+@@ -24,6 +24,7 @@ On Python 3, pygobject v3.4 or later is required.
+ from twisted.internet.error import ReactorAlreadyRunning
+ from twisted.internet import _glibbase
+ from twisted.python import runtime
++import gi # type: ignore[import]
+ import gi.pygtkcompat # type: ignore[import]
+ from gi.repository import GLib # type: ignore[import]
+
+@@ -68,6 +69,7 @@ class GIReactor(_glibbase.GlibReactorBase):
+ def __init__(self, useGtk=False):
+ _gtk = None
+ if useGtk is True:
++ gi.require_version("Gtk", "3.0")
+ from gi.repository import Gtk as _gtk
+
+ _glibbase.GlibReactorBase.__init__(self, GLib, _gtk, useGtk=useGtk)
+@@ -112,6 +114,7 @@ class PortableGIReactor(_glibbase.PortableGlibReactorBase):
+ def __init__(self, useGtk=False):
+ _gtk = None
+ if useGtk is True:
++ gi.require_version("Gtk", "3.0")
+ from gi.repository import Gtk as _gtk
+
+ _glibbase.PortableGlibReactorBase.__init__(self, GLib, _gtk, useGtk=useGtk)
+diff --git a/src/twisted/internet/test/test_gireactor.py b/src/twisted/internet/test/test_gireactor.py
+index d15a92622..af5092a36 100644
+--- a/src/twisted/internet/test/test_gireactor.py
++++ b/src/twisted/internet/test/test_gireactor.py
+@@ -25,6 +25,9 @@ else:
+ gtk3reactor = None
+ else:
+ gtk3reactor = _gtk3reactor
++ import gi # type: ignore[import]
++
++ gi.require_version("Gtk", "3.0")
+ from gi.repository import Gtk
+
+ from twisted.internet.error import ReactorAlreadyRunning
+diff --git a/src/twisted/newsfragments/10200.bugfix b/src/twisted/newsfragments/10200.bugfix
+new file mode 100644
+index 000000000..7afb343be
+--- /dev/null
++++ b/src/twisted/newsfragments/10200.bugfix
+@@ -0,0 +1 @@
++twisted.internet.gireactor was fixed to force GTK+3 in order to fix use of incompatible GTK+4 API when installed
+--
+2.32.0
+
diff --git a/dev-python/twisted/twisted-19.10.0.ebuild b/dev-python/twisted/twisted-19.10.0.ebuild
deleted file mode 100644
index cd70c36f469b..000000000000
--- a/dev-python/twisted/twisted-19.10.0.ebuild
+++ /dev/null
@@ -1,194 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7,8,9} )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 virtualx
-
-TWISTED_PN="Twisted"
-TWISTED_P="${TWISTED_PN}-${PV}"
-TWISTED_RELEASE=$(ver_cut 1-2)
-
-DESCRIPTION="An asynchronous networking framework written in Python"
-HOMEPAGE="https://www.twistedmatrix.com/trac/"
-SRC_URI="https://twistedmatrix.com/Releases/${TWISTED_PN}"
-SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2
- https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz"
-S=${WORKDIR}/${TWISTED_P}
-
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="conch crypt http2 serial test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=dev-python/attrs-17.4.0[${PYTHON_USEDEP}]
- >=dev-python/automat-0.3.0[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- >=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
- >=dev-python/pyhamcrest-1.9.0[${PYTHON_USEDEP}]
- >=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}]
- conch? (
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
- >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
- )
- crypt? (
- >=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
- dev-python/service_identity[${PYTHON_USEDEP}]
- >=dev-python/idna-0.6[${PYTHON_USEDEP}]
- )
- serial? ( >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] )
- http2? (
- >=dev-python/hyper-h2-3.0.0[${PYTHON_USEDEP}]
- <dev-python/hyper-h2-4.0.0[${PYTHON_USEDEP}]
- >=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
- <dev-python/priority-2.0[${PYTHON_USEDEP}]
- )
- !dev-python/twisted-core
- !dev-python/twisted-conch
- !dev-python/twisted-lore
- !dev-python/twisted-mail
- !dev-python/twisted-names
- !dev-python/twisted-news
- !dev-python/twisted-pair
- !dev-python/twisted-runner
- !dev-python/twisted-words
- !dev-python/twisted-web
-"
-DEPEND="
- dev-python/bcrypt
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
- test? (
- dev-python/gmpy[${PYTHON_USEDEP}]
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
- >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
- >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
- dev-python/service_identity[${PYTHON_USEDEP}]
- dev-python/idna[${PYTHON_USEDEP}]
- dev-python/pyserial[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
- net-misc/openssh
- )
-"
-
-python_prepare_all() {
- local PATCHES=(
- "${FILESDIR}"/${P}-py38.patch
- "${FILESDIR}"/twisted-19.10.0-py38-cgi.patch
- "${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
- "${FILESDIR}"/twisted-19.10.0-py39-b64.patch
- "${FILESDIR}"/twisted-20.3.0-py39-combined.patch
- )
-
- # upstream test for making releases; not very useful and requires
- # sphinx (including on py2)
- rm src/twisted/python/test/test_release.py || die
-
- # Conch doesn't work with latest >=OpenSSH 7.6
- # - https://twistedmatrix.com/trac/ticket/9311
- # - https://twistedmatrix.com/trac/ticket/9515
- rm src/twisted/conch/test/test_ckeygen.py || die
- rm src/twisted/conch/test/test_conch.py || die
- rm src/twisted/conch/test/test_cftp.py || die
-
- # puts system in EMFILE state, then the exception handler may fail
- # trying to open more files due to some gi magic
- sed -e '/SKIP_EMFILE/s:None:"Fails on non-pristine systems":' \
- -i src/twisted/internet/test/test_tcp.py || die
-
- # TODO: times out, i can't find where to increase the timeout
- sed -e 's:test_manyProcesses:_&:' \
- -i src/twisted/test/test_process.py || die
-
- # multicast tests fail within network-sandbox
- sed -e 's:test_joinLeave:_&:' \
- -e 's:test_loopback:_&:' \
- -e 's:test_multiListen:_&:' \
- -e 's:test_multicast:_&:' \
- -i src/twisted/test/test_udp.py || die
-
- # accesses /dev/net/tun
- sed -e '/class RealDeviceTestsMixin/a\
- skip = "Requires extra permissions"' \
- -i src/twisted/pair/test/test_tuntap.py || die
-
- # TODO: figure it out, probably doesn't accept DST date here
- sed -e 's:test_getTimezoneOffsetWithoutDaylightSavingTime:_&:' \
- -i src/twisted/test/test_log.py || die
-
- # TODO: failures specific to Python 2
- sed -e 's:testLookupProcNetTcp:_&:' \
- -i src/twisted/test/test_ident.py || die
- sed -e 's:test_loggingFactoryOpensLogfileAutomatically:_&:' \
- -i src/twisted/test/test_policies.py || die
-
- distutils-r1_python_prepare_all
-}
-
-src_test() {
- virtx distutils-r1_src_test
-}
-
-python_test() {
- # TODO: upstream seems to override our build paths
- distutils_install_for_testing
-
- "${EPYTHON}" -m twisted.trial twisted ||
- die "Tests failed with ${EPYTHON}"
-}
-
-python_install() {
- distutils-r1_python_install
-
- cd "${D}$(python_get_sitedir)" || die
-
- # own the dropin.cache so we don't leave orphans
- touch twisted/plugins/dropin.cache || die
-
- python_doscript "${WORKDIR}"/twisted-regen-cache
-}
-
-python_install_all() {
- distutils-r1_python_install_all
-
- newconfd "${FILESDIR}/twistd.conf" twistd
- newinitd "${FILESDIR}/twistd.init" twistd
-}
-
-python_postinst() {
- twisted-regen-cache || die
-}
-
-pkg_postinst() {
- python_foreach_impl python_postinst
-
- einfo "Install complete"
- if use test ; then
- einfo ""
- einfo "Some tests have been disabled during testing due to"
- einfo "known incompatibilities with the emerge sandboxes and/or"
- einfo "not runnable as the root user."
- einfo "For a complete test suite run on the code."
- einfo "Run the tests as a normal user for each python it is installed to."
- einfo " ie: $ python3.6 /usr/bin/trial twisted"
- fi
-}
-
-python_postrm() {
- rm -f "${ROOT}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die
-}
-
-pkg_postrm() {
- # if we're removing the last version, remove the cache file
- if [[ ! ${REPLACING_VERSIONS} ]]; then
- python_foreach_impl python_postrm
- fi
-}
diff --git a/dev-python/twisted/twisted-21.2.0-r1.ebuild b/dev-python/twisted/twisted-21.2.0-r1.ebuild
index 80810364d1cb..296e07d25869 100644
--- a/dev-python/twisted/twisted-21.2.0-r1.ebuild
+++ b/dev-python/twisted/twisted-21.2.0-r1.ebuild
@@ -17,7 +17,7 @@ S=${WORKDIR}/${PN}-${P}
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~riscv ~s390 sparc x86"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="conch crypt http2 serial test"
RESTRICT="!test? ( test )"
diff --git a/dev-python/twisted/twisted-20.3.0.ebuild b/dev-python/twisted/twisted-21.7.0.ebuild
index 48c006ad930f..68bcdd4ffffc 100644
--- a/dev-python/twisted/twisted-20.3.0.ebuild
+++ b/dev-python/twisted/twisted-21.7.0.ebuild
@@ -3,25 +3,21 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{8..10} )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 virtualx
-TWISTED_PN="Twisted"
-TWISTED_P="${TWISTED_PN}-${PV}"
-TWISTED_RELEASE=$(ver_cut 1-2)
-
DESCRIPTION="An asynchronous networking framework written in Python"
HOMEPAGE="https://www.twistedmatrix.com/trac/"
-SRC_URI="https://twistedmatrix.com/Releases/${TWISTED_PN}"
-SRC_URI="${SRC_URI}/${TWISTED_RELEASE}/${TWISTED_P}.tar.bz2
+SRC_URI="
+ https://github.com/twisted/twisted/archive/${P}.tar.gz
https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz"
-
-KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
+S=${WORKDIR}/${PN}-${P}
LICENSE="MIT"
SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="conch crypt http2 serial test"
RESTRICT="!test? ( test )"
@@ -30,13 +26,15 @@ RDEPEND="
>=dev-python/automat-0.3.0[${PYTHON_USEDEP}]
>=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
>=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+ >=dev-python/incremental-21.3.0[${PYTHON_USEDEP}]
>=dev-python/pyhamcrest-1.9.0[${PYTHON_USEDEP}]
+ >=dev-python/typing-extensions-3.6.5[${PYTHON_USEDEP}]
>=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}]
conch? (
- dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ dev-python/bcrypt[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
)
crypt? (
>=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
@@ -61,47 +59,37 @@ RDEPEND="
!dev-python/twisted-words
!dev-python/twisted-web
"
-DEPEND="
- dev-python/bcrypt
- >=dev-python/incremental-16.10.1[${PYTHON_USEDEP}]
+BDEPEND="
+ >=dev-python/incremental-21.3.0[${PYTHON_USEDEP}]
test? (
+ >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+ dev-python/bcrypt[${PYTHON_USEDEP}]
+ >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+ dev-python/cython-test-exception-raiser[${PYTHON_USEDEP}]
dev-python/gmpy[${PYTHON_USEDEP}]
+ dev-python/idna[${PYTHON_USEDEP}]
dev-python/pyasn1[${PYTHON_USEDEP}]
- >=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
- >=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
- dev-python/service_identity[${PYTHON_USEDEP}]
- dev-python/idna[${PYTHON_USEDEP}]
dev-python/pyserial[${PYTHON_USEDEP}]
- >=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+ dev-python/service_identity[${PYTHON_USEDEP}]
net-misc/openssh
)
"
-S=${WORKDIR}/${TWISTED_P}
+PATCHES=(
+ # https://twistedmatrix.com/trac/ticket/10200
+ "${FILESDIR}/${P}-force-gtk3.patch"
+)
python_prepare_all() {
- local PATCHES=(
- "${FILESDIR}"/twisted-20.3.0-py38-cgi.patch
- "${FILESDIR}"/twisted-20.3.0-py38-hmac.patch
- "${FILESDIR}"/twisted-20.3.0-py39-b64.patch
- "${FILESDIR}"/twisted-20.3.0-py39-combined.patch
- )
-
# upstream test for making releases; not very useful and requires
# sphinx (including on py2)
rm src/twisted/python/test/test_release.py || die
- # Conch doesn't work with latest >=OpenSSH 7.6
- # - https://twistedmatrix.com/trac/ticket/9311
- # - https://twistedmatrix.com/trac/ticket/9515
- rm src/twisted/conch/test/test_ckeygen.py || die
- rm src/twisted/conch/test/test_conch.py || die
- rm src/twisted/conch/test/test_cftp.py || die
-
# puts system in EMFILE state, then the exception handler may fail
# trying to open more files due to some gi magic
- sed -e '/SKIP_EMFILE/s:None:"Fails on non-pristine systems":' \
+ sed -e '/SKIP_EMFILE/s:False:True:' \
-i src/twisted/internet/test/test_tcp.py || die
# multicast tests fail within network-sandbox
@@ -116,15 +104,9 @@ python_prepare_all() {
skip = "Requires extra permissions"' \
-i src/twisted/pair/test/test_tuntap.py || die
- # TODO: figure it out, probably doesn't accept DST date here
- sed -e 's:test_getTimezoneOffsetWithoutDaylightSavingTime:_&:' \
- -i src/twisted/test/test_log.py || die
-
- # TODO: failures specific to Python 2
- sed -e 's:testLookupProcNetTcp:_&:' \
- -i src/twisted/test/test_ident.py || die
- sed -e 's:test_loggingFactoryOpensLogfileAutomatically:_&:' \
- -i src/twisted/test/test_policies.py || die
+ # These tests rely on warnings which seems work unreliably between python versions
+ sed -e 's:test_currentEUID:_&:' \
+ -e 's:test_currentUID:_&:' -i src/twisted/python/test/test_util.py || die
distutils-r1_python_prepare_all
}