From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Oct 4 16:40:02 2007 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EE0816A474 for ; Thu, 4 Oct 2007 16:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E7D7713C469 for ; Thu, 4 Oct 2007 16:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l94Ge1At067351 for ; Thu, 4 Oct 2007 16:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l94Ge1m1067350; Thu, 4 Oct 2007 16:40:01 GMT (envelope-from gnats) Resent-Date: Thu, 4 Oct 2007 16:40:01 GMT Resent-Message-Id: <200710041640.l94Ge1m1067350@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Philip M. Gollucci" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6952816A420 for ; Thu, 4 Oct 2007 16:35:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 605D713C46A for ; Thu, 4 Oct 2007 16:35:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l94GZOru058664 for ; Thu, 4 Oct 2007 16:35:24 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l94GZOx9058663; Thu, 4 Oct 2007 16:35:24 GMT (envelope-from nobody) Message-Id: <200710041635.l94GZOx9058663@www.freebsd.org> Date: Thu, 4 Oct 2007 16:35:24 GMT From: "Philip M. Gollucci" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/116914: Fix mail/svnmailer with lang/python25+ X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2007 16:40:02 -0000 >Number: 116914 >Category: ports >Synopsis: Fix mail/svnmailer with lang/python25+ >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Oct 04 16:40:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Philip M. Gollucci >Release: FreeBSD 7.0-current >Organization: Riderway Inc. >Environment: FreeBSD philip.hq.rws 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Thu Jul 26 16:44:37 EDT 2007 root@philip.office.rws:/usr/obj/usr/src/sys/GENERIC i386 >Description: Starting with Python 2.5 (PYTHON_REL == 250) Exceptional Handling is built-in. See Misc/News: * Exceptions are now built-in in python (LP: #111735) (Thanks to Daniel Gruen for providing the patch) * debian/control: Modify Maintainer value to match DebianMaintainerField spec. mail/svnmailer doesn't account for this. >How-To-Repeat: cvsup to a ports tree post 2.5 python default. cd mail/svnmailer make install #!/bin/sh SVNADMIN=/usr/local/bin/svnadmin MAILER=/usr/local/bin/svn-mailer CONFIG=/usr/local/etc/svn-mailer.conf REPOS=/home/svn $MAILER -d "$REPOS" -r "1" -f $CONFIG Notifier: svnmailer.util.SplittingDecorator Revision: 3428 Groups: [u'defaults'] Traceback (most recent call last): File "/usr/local/lib/python2.5/site-packages/svnmailer/main.py", line 101, in run notifier.run() File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_mail.py", line 62, in run for mail in self.getMails(): File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_mail.py", line 83, in getMails for mail in self.composeMail(): File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_textmail.py", line 131, in composeMail self.writeNotification() File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_mail.py", line 96, in writeNotification self.writeDiffList() File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_text.py", line 183, in writeDiffList self.writeContentDiff(change) File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_textmail.py", line 303, in writeContentDiff self.__super.writeContentDiff(change) File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_text.py", line 352, in writeContentDiff change, enc = enc, default = default File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_base.py", line 300, in dumpContent enc1, enc2 = self.getContentEncodings(change) File "/usr/local/lib/python2.5/site-packages/svnmailer/notifier/_base.py", line 348, in getContentEncodings from encodings import exceptions ImportError: cannot import name exceptions >Fix: Conditionally apply this patch if PYTHON_REL >= 250 Patch obtained from: http://launchpadlibrarian.net/8131802/svnmailer-1.0.8-python2.5.diff Note additional of files directory and new patch file. portlint -ACN port looks clean. Patch attached with submission follows: ? files/25-patch-src__lib__svnmailer__notifier___base.py Index: Makefile =================================================================== RCS file: /home/ncvs/ports/mail/svnmailer/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- Makefile 19 Dec 2006 21:19:04 -0000 1.7 +++ Makefile 4 Oct 2007 03:57:54 -0000 @@ -19,6 +19,11 @@ USE_PYTHON= 2.3+ USE_PYDISTUTILS= yes +.include +.if ${PYTHON_REL} >= 250 +EXTRA_PATCHES+= ${FILESDIR}/25-patch-src__lib__svnmailer__notifier___base.py +.endif + PORTDOCS= index.html perlig.css perlig.jpg perlig_docs.css \ perlig_offline.css right.gif up.gif @@ -32,4 +37,4 @@ cd ${WRKSRC}/docs; ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} .endif -.include +.include --- /dev/null 2007-10-03 23:57:27.000000000 -0400 +++ files/25-patch-src__lib__svnmailer__notifier___base.py 2007-10-03 23:40:08.000000000 -0400 @@ -0,0 +1,45 @@ +--- ./src/lib/svnmailer/notifier/_base.py.orig 2006-04-17 06:29:06.000000000 -0400 ++++ ./src/lib/svnmailer/notifier/_base.py 2007-10-03 23:39:56.000000000 -0400 +@@ -345,7 +345,6 @@ + @return: The two encodings + @rtype: C{tuple} of C{str} + """ +- from encodings import exceptions + + enc1 = enc2 = default + if not change.wasAdded() or change.wasCopied(): +@@ -353,7 +352,7 @@ + enc1 = self._getContentEncoding( + change.getBasePath(), change.getBaseRevision() + ) +- except exceptions.LookupError: ++ except LookupError: + # fall back + pass + +@@ -364,7 +363,7 @@ + enc2 = self._getContentEncoding( + change.path, change.revision + ) +- except exceptions.LookupError: ++ except LookupError: + # fall back + pass + +@@ -389,7 +388,6 @@ + @exception encodings.exception.LookupError: The specified encoding + is not implemented or no encoding was specified + """ +- from encodings import exceptions + + # first try the svn:mime-type + enc = self.getEncodingFromMimeType(path, revision) +@@ -427,7 +425,7 @@ + codecs.lookup(enc) + return enc + +- raise exceptions.LookupError("No Encoding configured") ++ raise LookupError("No Encoding configured") + + + def getEncodingFromMimeType(self, path, revision): >Release-Note: >Audit-Trail: >Unformatted: