From nobody Thu Aug 4 22:43:22 2022 X-Original-To: dev-commits-ports-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LzNzv2Bxcz4Y9ty; Thu, 4 Aug 2022 22:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LzNzv1Rjzz40tC; Thu, 4 Aug 2022 22:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659653003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eqqF+OpGTB+c7o4Nw0/cgMWhSPvVS52ggA34g9771PY=; b=DslP8Fuftd3xz4ZtILRxP2LQd7kFWFeKC06XgzKZ0tcSXsIZRH8/O4+tOx+jToL0g5EQ21 IOyCPXsCxyp9sIplxF2KVtlEhCo8M0PhhoYQSZyc26GangwPGgDvzb+9oj+12qASDJpvWe S6jWh+3oP+4w6+sCsSdo3N4QBYdbIk+nvWAHr+QB9XBUE73ZcZvtt+VRtat0zMHn9WtmqC EgTiBuzNX+8GMjTIYBU7qaT3D8Uz21skH2tpuG71TH4b8BIa8SYtcGsWCAYRTW0+p+FnKq xyYSVzeAkkkTxWnqRT5zp2UreleYrCdE3y3HyZAA+D9167h49VNSdjl60Ifwew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LzNzv0SsxzXMm; Thu, 4 Aug 2022 22:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 274MhMJO076263; Thu, 4 Aug 2022 22:43:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 274MhMpB076262; Thu, 4 Aug 2022 22:43:22 GMT (envelope-from git) Date: Thu, 4 Aug 2022 22:43:22 GMT Message-Id: <202208042243.274MhMpB076262@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: "Danilo G. Baio" Subject: git: 7839223a2353 - 2022Q3 - mail/pyzor: Fix runtime with Python 3.9 List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-branches@freebsd.org X-BeenThere: dev-commits-ports-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dbaio X-Git-Repository: ports X-Git-Refname: refs/heads/2022Q3 X-Git-Reftype: branch X-Git-Commit: 7839223a2353e58f18b5733abc69967f7354a30e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659653003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eqqF+OpGTB+c7o4Nw0/cgMWhSPvVS52ggA34g9771PY=; b=ouQgpWABhyPzzPZVLNSB3ZUSgtl+dbiObFOCicYzo1OmRBCn2fOJtNI0Z20REP/9i1dczX s+WOBV1PsxWtGk2hHHpY67tjHQDm/EByYa7vge/CYhY/wJ214qYCoyi8cZuE5pJNsSM/V6 B0fCpw0bnEy5HIl6Fd3S/9fR0pgwXjEum2hMMD3eDw3HM68URzhWGAdGZhxordNsa2D1kO VSv2ziFvnehYw9Adfns6jb2nvyYP670qbvJAMz4D3o3ECAS9Ord+cjV+Ml0gGVg4jEqOIt yjYI+bdUnTDThok+Vn4RTRHMmzUp8c/bthC5Fh+yPAIhU+/6aHzv50jsJgl3iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659653003; a=rsa-sha256; cv=none; b=old35DrCQYXvMkb4QmM/v4gi5Aq71CBMxb8+dSF6I5L0/njWbCwEd8EWyIT4Dohor+m+U2 2Ormrb9C6BFaLGBu6Eqsiw3uw2PWVps+E/owcTzA7E5lmX2/rfhUsbCWMNcf7Ud/7+kE0x Op6MysyXDZMvC2GPXO9R/hb+w4Z+W+nfjOEgHuqKsXB3D8L9eeqU5QmIn3gLqBWRR8cUaW 9AjiJVmTJkxpjibqATeggh+MY2/DSAzBfYT7+pxEUF/rJHD2fxtVEus2lsUtso59USEJu/ giBDhBuJFdnuXZLTTTVdTDKc3n/vET4iTjmFIHw5mLWFEyN76VrpDKHwGN/Adg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch 2022Q3 has been updated by dbaio: URL: https://cgit.FreeBSD.org/ports/commit/?id=7839223a2353e58f18b5733abc69967f7354a30e commit 7839223a2353e58f18b5733abc69967f7354a30e Author: Danilo G. Baio AuthorDate: 2022-07-15 22:05:37 +0000 Commit: Danilo G. Baio CommitDate: 2022-08-04 22:42:04 +0000 mail/pyzor: Fix runtime with Python 3.9 Partial patch of https://github.com/SpamExperts/pyzor/commit/7afe0aedc320dd2689bfbf45e97fdb09adb89686 PR: 265237 [1] Reported by: Jakob Stoklund Olesen [1] Reported by: Andrew (cherry picked from commit c0927c63a74f462bcbaa415ea6b906c66d691188) --- mail/pyzor/Makefile | 2 +- mail/pyzor/files/patch-7afe0ae.patch | 182 +++++++++++++++++++++++++++++++++++ 2 files changed, 183 insertions(+), 1 deletion(-) diff --git a/mail/pyzor/Makefile b/mail/pyzor/Makefile index b03120be829a..21225f276682 100644 --- a/mail/pyzor/Makefile +++ b/mail/pyzor/Makefile @@ -2,7 +2,7 @@ PORTNAME= pyzor PORTVERSION= 1.0.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/mail/pyzor/files/patch-7afe0ae.patch b/mail/pyzor/files/patch-7afe0ae.patch new file mode 100644 index 000000000000..21cfd2b76adc --- /dev/null +++ b/mail/pyzor/files/patch-7afe0ae.patch @@ -0,0 +1,182 @@ +partial: + +From 7afe0aedc320dd2689bfbf45e97fdb09adb89686 Mon Sep 17 00:00:00 2001 +From: Alexandru Chirila +Date: Fri, 15 Jan 2016 12:30:39 +0200 +Subject: [PATCH] Refs. #46. Fix all unitest for Python3. + +Adjust all the unittest and code to pass on Python3 +without any 2to3 conversion (even without the +python-future library installed). +--- + pyzor/client.py | 6 ++-- + pyzor/digest.py | 2 +- + pyzor/engines/common.py | 4 +-- + pyzor/engines/gdbm_.py | 2 +- + pyzor/engines/mysql.py | 2 +- + pyzor/server.py | 4 +-- + scripts/pyzor | 4 +-- + scripts/pyzord | 2 +- + +| ------------------------------------------ | +| removed from original patch: +| +| scripts/run_tests | 5 ++-- +| tests/benchmark/measure_server_response.py | 8 ++--- +| tests/functional/test_pyzor.py | 22 +++++++------- +| tests/unit/test_account.py | 35 +++++++++++----------- +| tests/unit/test_config.py | 7 +++-- +| tests/unit/test_engines/test_gdbm.py | 2 +- +| tests/unit/test_forwarder.py | 2 +- +| tests/unit/test_server.py | 9 ++++-- +| tests/util/__init__.py | 8 ++--- +| web/application.py | 4 +-- +| ------------------------------------------ | + 18 files changed, 67 insertions(+), 61 deletions(-) + +diff --git a/pyzor/client.py b/pyzor/client.py +index 82d6361..07daba2 100644 +--- pyzor/client.py ++++ pyzor/client.py +@@ -78,7 +78,7 @@ def __init__(self, accounts=None, timeout=None, spec=None): + if accounts is None: + accounts = {} + self.accounts = dict(((host, int(port)), account) +- for (host, port), account in accounts.iteritems()) ++ for (host, port), account in accounts.items()) + if spec is None: + spec = pyzor.digest.digest_spec + self.spec = spec +@@ -227,12 +227,12 @@ def flush(self): + + def force(self): + """Force send any remaining reports.""" +- for address, msg in self.r_requests.iteritems(): ++ for address, msg in self.r_requests.items(): + try: + self.send(msg, address) + except: + continue +- for address, msg in self.w_requests.iteritems(): ++ for address, msg in self.w_requests.items(): + try: + self.send(msg, address) + except: +diff --git a/pyzor/digest.py b/pyzor/digest.py +index 100a4c6..058c208 100644 +--- pyzor/digest.py ++++ pyzor/digest.py +@@ -105,7 +105,7 @@ def handle_atomic(self, lines): + def handle_pieced(self, lines, spec): + """Digest stuff according to the spec.""" + for offset, length in spec: +- for i in xrange(length): ++ for i in range(length): + try: + line = lines[int(offset * len(lines) // 100) + i] + except IndexError: +diff --git a/pyzor/engines/common.py b/pyzor/engines/common.py +index a96c656..17f083c 100644 +--- pyzor/engines/common.py ++++ pyzor/engines/common.py +@@ -31,7 +31,7 @@ def __init__(self, r_count=0, wl_count=0, r_entered=None, + + def wl_increment(self): + # overflow prevention +- if self.wl_count < sys.maxint: ++ if self.wl_count < sys.maxsize: + self.wl_count += 1 + if self.wl_entered is None: + self.wl_entered = datetime.datetime.now() +@@ -39,7 +39,7 @@ def wl_increment(self): + + def r_increment(self): + # overflow prevention +- if self.r_count < sys.maxint: ++ if self.r_count < sys.maxsize: + self.r_count += 1 + if self.r_entered is None: + self.r_entered = datetime.datetime.now() +diff --git a/pyzor/engines/gdbm_.py b/pyzor/engines/gdbm_.py +index d9415ba..e75fbd3 100644 +--- pyzor/engines/gdbm_.py ++++ pyzor/engines/gdbm_.py +@@ -75,7 +75,7 @@ def items(self): + def apply_method(self, method, varargs=(), kwargs=None): + if kwargs is None: + kwargs = {} +- return apply(method, varargs, kwargs) ++ return method(*varargs, **kwargs) + + def __getitem__(self, key): + return self.apply_method(self._really_getitem, (key,)) +diff --git a/pyzor/engines/mysql.py b/pyzor/engines/mysql.py +index baef14d..f8d893d 100644 +--- pyzor/engines/mysql.py ++++ pyzor/engines/mysql.py +@@ -294,7 +294,7 @@ def _safe_call(self, name, method, args): + def reconnect(self): + if not self.bound: + return +- for _ in xrange(self.bound): ++ for _ in range(self.bound): + self.db_queue.put(self._get_new_connection()) + + def _reconnect(self, db): +diff --git a/pyzor/server.py b/pyzor/server.py +index abae192..b342222 100644 +--- pyzor/server.py ++++ pyzor/server.py +@@ -137,7 +137,7 @@ def __init__(self, address, database, passwd_fn, access_fn, prefork=4): + def serve_forever(self, poll_interval=0.5): + """Fork the current process and wait for all children to finish.""" + pids = [] +- for dummy in xrange(self._prefork): ++ for dummy in range(self._prefork): + database = self.database.next() + pid = os.fork() + if not pid: +@@ -312,7 +312,7 @@ def handle_pong(self, digests): + This command returns maxint for report counts and 0 whitelist. + """ + self.server.log.debug("Request pong for %s", digests[0]) +- self.response["Count"] = "%d" % sys.maxint ++ self.response["Count"] = "%d" % sys.maxsize + self.response["WL-Count"] = "%d" % 0 + + def handle_check(self, digests): +diff --git a/scripts/pyzor b/scripts/pyzor +index 19b1d21..040b4c5 100755 +--- scripts/pyzor ++++ scripts/pyzor +@@ -110,7 +110,7 @@ def load_configuration(): + config = ConfigParser.ConfigParser() + # Set the defaults. + config.add_section("client") +- for key, value in defaults.iteritems(): ++ for key, value in defaults.items(): + config.set("client", key, value) + # Override with the configuration. + config.read(os.path.join(options.homedir, "config")) +@@ -372,7 +372,7 @@ def genkey(client, servers, config, hash_func=hashlib.sha1): + return False + # pylint: disable-msg=W0612 + salt = "".join([chr(random.randint(0, 255)) +- for unused in xrange(hash_func(b"").digest_size)]) ++ for unused in range(hash_func(b"").digest_size)]) + if sys.version_info >= (3, 0): + salt = salt.encode("utf8") + salt_digest = hash_func(salt) +diff --git a/scripts/pyzord b/scripts/pyzord +index 7b073a7..3ac7a2c 100755 +--- scripts/pyzord ++++ scripts/pyzord +@@ -244,7 +244,7 @@ def load_configuration(): + config = ConfigParser.ConfigParser() + # Set the defaults. + config.add_section("server") +- for key, value in defaults.iteritems(): ++ for key, value in defaults.items(): + config.set("server", key, value) + # Override with the configuration. + config.read(os.path.join(options.homedir, "config"))