From nobody Fri Mar 25 13:50:31 2022 X-Original-To: dev-commits-ports-main@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 4001F1A3416B; Fri, 25 Mar 2022 13:50:34 +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 4KQ3Q11NzFz3RKm; Fri, 25 Mar 2022 13:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216233; 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=IpOBb39Ckh88KczkTsC4wIuwFQjoVJXl3C2lWAZgJcA=; b=WkxuFke5HroKHWSCdJzR989bAHKKrasQ40MGsWbS/lcQdH3ZklW6pnADcxQyrGoIJKpFdd qyEe7bAxW9Xj7Xysj+EvdPMmH3O6y1rue0fK67K9vTSEtsG3Zfv64wnRQFYyKe5/0pgN76 seWiOszUZkfJwfbA7/X/zRVSnWAY/HFLo3xT5hEgnQq7dc8NvZagfegtc/JtcYWHYwGgEh /RGTMD1BpOncfqDMAkBoOZ7mmG1WSIms0/RCULRM83tGZ5w609s1tdeJwiWf0N5tRBgcO8 hZWO5tK5rNQbIm0ovml8Zb9IGHvFQxAfSstJ41yAH6OCx3xOIgSEkuP3sMDMsQ== 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 D421C5955; Fri, 25 Mar 2022 13:50:31 +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 22PDoV1L037063; Fri, 25 Mar 2022 13:50:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22PDoVrW037062; Fri, 25 Mar 2022 13:50:31 GMT (envelope-from git) Date: Fri, 25 Mar 2022 13:50:31 GMT Message-Id: <202203251350.22PDoVrW037062@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 83f077afd9ae - main - mail/py-Products.SecureMailHost: Fix build with setuptools 58.0.0+ List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83f077afd9aea74ccd019df5d947d7e94b5b744f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216233; 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=IpOBb39Ckh88KczkTsC4wIuwFQjoVJXl3C2lWAZgJcA=; b=f/wlFDHKJEH17LdU+1O95Q79GcLWXUJuG66RfE+y5IPRAsOu//ZkClNMw6QCsU+TqW4PVz 8g99bZXfHToOgsgjk2B86MgyLtU7zpVLxIoisvgPGhPq2Vzfdzoq6OML7/dxeFnoxC+/0F 1KUhKMsB1FhIZvz/1FacellwpSuk6si1YICu/iwCqTO6309IHgUcjpICOIH2rq/mmrFDWv vzxaytgAKyXjVcp20BcK04kWu4KtnXOryoPYwzOgo2IA3/ZxnFp7LALPhRPT18Scq6s8pp jo3m1qvlbwP6Ul6wzgsTwPz/1zxZ3B5VsLRrAzn7ay3QIVUgpNIcJ1e2UTzKBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648216233; a=rsa-sha256; cv=none; b=k3p62RIXHHLmt8JHYPiH82LukABN0Q/KhrTXU9fUhL0Bn5v4OmOBaWwwG7RHIRG6BZJOKU oDB/i5cZtluNbyAi1/99Nl4gqyPtSdAy9X+iW3/niXU/2Fk51eOnjW6EMT7QztByR8HAOK PTyZIq/pzETO0heTZH46nEX6cYPjyVpB2XKiJR3/XnoAsCoeD28LR0je0b1//3B+pnltjC HDCe2p6A26OWg5x6c/hfLC4GEBluu+0sXdz8/LvyIlJhkZYB6TjaEQ+jUEtlR0oSrPMi3J KDKn6c4apo91jKwje33510NjG3t14LcWmLFD/ipj4N1YxPDeD3i21hYH2QGOug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=83f077afd9aea74ccd019df5d947d7e94b5b744f commit 83f077afd9aea74ccd019df5d947d7e94b5b744f Author: Po-Chuan Hsieh AuthorDate: 2022-03-25 13:32:36 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-03-25 13:38:16 +0000 mail/py-Products.SecureMailHost: Fix build with setuptools 58.0.0+ With hat: python --- mail/py-Products.SecureMailHost/files/patch-2to3 | 165 +++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/mail/py-Products.SecureMailHost/files/patch-2to3 b/mail/py-Products.SecureMailHost/files/patch-2to3 new file mode 100644 index 000000000000..8f5b763bd1e4 --- /dev/null +++ b/mail/py-Products.SecureMailHost/files/patch-2to3 @@ -0,0 +1,165 @@ +--- Products/SecureMailHost/SecureMailHost.py.orig 2009-09-05 08:33:50 UTC ++++ Products/SecureMailHost/SecureMailHost.py +@@ -16,7 +16,7 @@ + $Id: SecureMailHost.py 96773 2009-09-05 14:33:50Z hannosch $ + """ + +-from config import BAD_HEADERS ++from .config import BAD_HEADERS + from copy import deepcopy + + import email.Message +@@ -201,10 +201,10 @@ class SecureMailBase(MailBase): + if addr: + result = self.validateEmailAddresses(addr) + if not result: +- raise MailHostError, 'Invalid email address: %s' % addr ++ raise MailHostError('Invalid email address: %s' % addr) + result = self.validateSingleEmailAddress(mfrom) + if not result: +- raise MailHostError, 'Invalid email address: %s' % mfrom ++ raise MailHostError('Invalid email address: %s' % mfrom) + + # create message + if isinstance(message, email.Message.Message): +@@ -212,7 +212,7 @@ class SecureMailBase(MailBase): + # change the message + msg = deepcopy(message) + else: +- if isinstance(message, unicode): ++ if isinstance(message, str): + message = message.encode(charset) + msg = email.MIMEText.MIMEText(message, subtype, charset) + +@@ -228,7 +228,7 @@ class SecureMailBase(MailBase): + + for bad in BAD_HEADERS: + if bad in kwargs: +- raise MailHostError, 'Header %s is forbidden' % bad ++ raise MailHostError('Header %s is forbidden' % bad) + self.setHeaderOf(msg, **kwargs) + + # we have to pass *all* recipient email addresses to the +@@ -251,7 +251,7 @@ class SecureMailBase(MailBase): + + All occurences of the key are deleted first! + """ +- for key, val in kwargs.items(): ++ for key, val in list(kwargs.items()): + del msg[key] # save - email.Message won't raise a KeyError + if skipEmpty and not val: + continue +@@ -293,7 +293,7 @@ class SecureMailBase(MailBase): + # stage 2: get a list of address strings using email.formataddr + addresses = [] + for addr in addr_list: +- if isinstance(addr, basestring): ++ if isinstance(addr, str): + addresses.append(email.Utils.formataddr(('', addr))) + else: + if len(addr) != 2: +@@ -311,7 +311,7 @@ class SecureMailBase(MailBase): + """Lower-level function to validate a single normalized email + address, see validateEmailAddress + """ +- if not isinstance(address, basestring): ++ if not isinstance(address, str): + return False + + sub = EMAIL_CUTOFF_RE.match(address); +@@ -329,7 +329,7 @@ class SecureMailBase(MailBase): + def validateSingleEmailAddress(self, address): + """Validate a single email address, see also validateEmailAddresses + """ +- if not isinstance(address, basestring): ++ if not isinstance(address, str): + return False + + sub = EMAIL_CUTOFF_RE.match(address); +@@ -353,7 +353,7 @@ class SecureMailBase(MailBase): + """Validate a list of possibly several email addresses, see + also validateSingleEmailAddress + """ +- if not isinstance(addresses, basestring): ++ if not isinstance(addresses, str): + return False + + sub = EMAIL_CUTOFF_RE.match(addresses); +--- Products/SecureMailHost/tests/common.py.orig 2004-07-18 15:21:52 UTC ++++ Products/SecureMailHost/tests/common.py +@@ -2,12 +2,6 @@ from Testing import ZopeTestCase + + from Products.SecureMailHost.SecureMailHost import SecureMailBase + +-try: +- True +-except NameError: +- True=1 +- False=0 +- + ZopeTestCase.installProduct('MailHost', quiet=1) + ZopeTestCase.installProduct('PageTemplates', quiet=1) + ZopeTestCase.installProduct('PythonScripts', quiet=1) +--- Products/SecureMailHost/tests/framework.py.orig 2004-05-16 01:36:28 UTC ++++ Products/SecureMailHost/tests/framework.py +@@ -52,7 +52,7 @@ if __INSTANCE_HOME.endswith(os.sep): + + # Find and import the Testing package + # +-if not sys.modules.has_key('Testing'): ++if 'Testing' not in sys.modules: + p0 = sys.path[0] + if p0 and __name__ == '__main__': + os.chdir(p0) +@@ -66,12 +66,12 @@ if not sys.modules.has_key('Testing'): + break + p, d = s and ('','') or os.path.split(p) + else: +- print 'Unable to locate Testing package.', +- print 'You might need to set SOFTWARE_HOME.' ++ print('Unable to locate Testing package.', end=' ') ++ print('You might need to set SOFTWARE_HOME.') + sys.exit(1) + + import Testing, unittest +-execfile(os.path.join(os.path.dirname(Testing.__file__), 'common.py')) ++exec(compile(open(os.path.join(os.path.dirname(Testing.__file__), 'common.py'), "rb").read(), os.path.join(os.path.dirname(Testing.__file__), 'common.py'), 'exec')) + + # Include ZopeTestCase support + # +@@ -80,8 +80,8 @@ if 1: # Create a new scope + p = os.path.join(os.path.dirname(Testing.__file__), 'ZopeTestCase') + + if not os.path.isdir(p): +- print 'Unable to locate ZopeTestCase package.', +- print 'You might need to install ZopeTestCase.' ++ print('Unable to locate ZopeTestCase package.', end=' ') ++ print('You might need to install ZopeTestCase.') + sys.exit(1) + + ztc_common = 'ztc_common.py' +@@ -89,19 +89,19 @@ if 1: # Create a new scope + + f = 0 + if os.path.exists(ztc_common_global): +- execfile(ztc_common_global) ++ exec(compile(open(ztc_common_global, "rb").read(), ztc_common_global, 'exec')) + f = 1 + if os.path.exists(ztc_common): +- execfile(ztc_common) ++ exec(compile(open(ztc_common, "rb").read(), ztc_common, 'exec')) + f = 1 + + if not f: +- print 'Unable to locate %s.' % ztc_common ++ print('Unable to locate %s.' % ztc_common) + sys.exit(1) + + # Debug + # +-print 'SOFTWARE_HOME: %s' % os.environ.get('SOFTWARE_HOME', 'Not set') +-print 'INSTANCE_HOME: %s' % os.environ.get('INSTANCE_HOME', 'Not set') ++print('SOFTWARE_HOME: %s' % os.environ.get('SOFTWARE_HOME', 'Not set')) ++print('INSTANCE_HOME: %s' % os.environ.get('INSTANCE_HOME', 'Not set')) + sys.stdout.flush() +