From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Feb 22 00:30:21 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8197116A4CE for ; Tue, 22 Feb 2005 00:30:21 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BF1743D2D for ; Tue, 22 Feb 2005 00:30:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1M0UKnI041287 for ; Tue, 22 Feb 2005 00:30:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1M0UKrx041285; Tue, 22 Feb 2005 00:30:20 GMT (envelope-from gnats) Resent-Date: Tue, 22 Feb 2005 00:30:20 GMT Resent-Message-Id: <200502220030.j1M0UKrx041285@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, Linh Pham Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 428A916A4CE; Tue, 22 Feb 2005 00:21:54 +0000 (GMT) Received: from q.closedsrc.org (ip233.gte244.dsl-acs2.sea.iinet.com [209.20.244.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id A38CC43D31; Tue, 22 Feb 2005 00:21:53 +0000 (GMT) (envelope-from question@closedsrc.org) Received: by q.closedsrc.org (Postfix, from userid 1001) id 068E64503E; Mon, 21 Feb 2005 16:21:47 -0800 (PST) Message-Id: <20050222002147.068E64503E@q.closedsrc.org> Date: Mon, 21 Feb 2005 16:21:47 -0800 (PST) From: Linh Pham To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: sergei@FreeBSD.org cc: m_zwart@123mail.org Subject: ports/77896: mail/getmail: Add patch to not use "strict" with Python 2.4 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Linh Pham List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2005 00:30:21 -0000 >Number: 77896 >Category: ports >Synopsis: mail/getmail: Add patch to not use "strict" with Python 2.4 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Tue Feb 22 00:30:20 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Linh Pham >Release: FreeBSD 5.3-RELEASE-p4 i386 >Organization: >Environment: System: FreeBSD q.internal.closedsrc.org 5.3-RELEASE-p4 FreeBSD 5.3-RELEASE-p4 #5: Sat Jan 8 23:34:57 PST 2005 question@q.internal.closedsrc.org:/usr/obj/usr/src/sys/Q i386 >Description: Add patches to mail/getmail to tell modules not to use "strict" when program is executed with Python 2.4 or newer. Borrowed patch from Gentoo Portage of net-mail/getmail. Credit goes to Marien Zwart per the following Gentoo Portage change log entry: 09 Feb 2005; Andrej Kacian +files/python2.4-fix.patch, +getmail-4.2.5-r1.ebuild, +getmail-4.3.1-r1.ebuild, getmail-4.3.2.ebuild: Fix deprecation warnings for "strict" usage in python 2.4. Patch submitted by Marien Zwart , bug #80073. Only change I made was to clean up the code a wee bit. >How-To-Repeat: >Fix: --- getmail,python2.4-patches.diff begins here --- diff -ruN /usr/ports/mail/getmail/files/patch-message.py getmail/files/patch-message.py --- /usr/ports/mail/getmail/files/patch-message.py Wed Dec 31 16:00:00 1969 +++ getmail/files/patch-message.py Mon Feb 21 16:09:33 2005 @@ -0,0 +1,43 @@ +--- getmailcore/message.py.orig Mon Feb 21 15:57:08 2005 ++++ getmailcore/message.py Mon Feb 21 16:04:17 2005 +@@ -7,6 +7,7 @@ + 'Message', + ] + ++import sys + import os + import time + import cStringIO +@@ -86,20 +87,28 @@ + # of filters, etc, which should be saner. + if fromlines: + try: +- self.__msg = email.message_from_string(os.linesep.join( +- fromlines), strict=False) ++ if sys.version_info < (2, 4): ++ self.__msg = email.message_from_string(os.linesep.join(fromlines), strict=False) ++ else: ++ self.__msg = email.message_from_string(os.linesep.join(fromlines)) + except email.Errors.MessageError, o: + self.__msg = corrupt_message(o, fromlines=fromlines) + self.__raw = os.linesep.join(fromlines) + elif fromstring: + try: +- self.__msg = email.message_from_string(fromstring, strict=False) ++ if sys.version_info < (2, 4): ++ self.__msg = email.message_from_string(fromstring, strict=False) ++ else: ++ self.__msg = email.message_from_string(fromstring) + except email.Errors.MessageError, o: + self.__msg = corrupt_message(o, fromstring=fromstring) + self.__raw = fromstring + elif fromfile: + try: +- self.__msg = email.message_from_file(fromfile, strict=False) ++ if sys.version_info < (2, 4): ++ self.__msg = email.message_from_file(fromfile, strict=False) ++ else: ++ self.__msg = email.message_from_file(fromfile) + except email.Errors.MessageError, o: + # Shouldn't happen + self.__msg = corrupt_message(o, fromstring=fromfile.read()) diff -ruN /usr/ports/mail/getmail/files/patch-retrieverbases.py getmail/files/patch-retrieverbases.py --- /usr/ports/mail/getmail/files/patch-retrieverbases.py Wed Dec 31 16:00:00 1969 +++ getmail/files/patch-retrieverbases.py Mon Feb 21 16:09:19 2005 @@ -0,0 +1,23 @@ +--- getmailcore/_retrieverbases.py.orig Mon Feb 21 15:57:08 2005 ++++ getmailcore/_retrieverbases.py Mon Feb 21 15:59:11 2005 +@@ -33,6 +33,7 @@ + 'RetrieverSkeleton', + ] + ++import sys + import os + import socket + import time +@@ -445,7 +446,11 @@ + self.log.trace() + msgnum = self._getmsgnumbyid(msgid) + response, headerlist, octets = self.conn.top(msgnum, 0) +- parser = email.Parser.Parser(strict=False) ++ # 'strict' argument is deprecated in Python 2.4 ++ if sys.version_info < (2, 4): ++ parser = email.Parser.Parser(strict=False) ++ else: ++ parser = email.Parser.Parser() + return parser.parsestr(os.linesep.join(headerlist), headersonly=True) + + def initialize(self): --- getmail,python2.4-patches.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: