From: W. Trevor King Date: Mon, 3 Feb 2014 10:59:20 +0000 (+1600) Subject: [PATCH 02/17] nmbug-status: Use email.utils instead of rfc822 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=567a85a8e90a5f7ca64a00c9d3b9bad018ce57ad;p=notmuch-archives.git [PATCH 02/17] nmbug-status: Use email.utils instead of rfc822 --- diff --git a/53/19788c8e32f98f64e5d2cd4f4a42b0d3ad4ba5 b/53/19788c8e32f98f64e5d2cd4f4a42b0d3ad4ba5 new file mode 100644 index 000000000..02c1049b2 --- /dev/null +++ b/53/19788c8e32f98f64e5d2cd4f4a42b0d3ad4ba5 @@ -0,0 +1,102 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1F080431FDB + for ; Mon, 3 Feb 2014 03:00:47 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 7avDuEMiE4Ds for ; + Mon, 3 Feb 2014 03:00:39 -0800 (PST) +Received: from qmta03.westchester.pa.mail.comcast.net + (qmta03.westchester.pa.mail.comcast.net [76.96.62.32]) + by olra.theworths.org (Postfix) with ESMTP id 70803431E64 + for ; Mon, 3 Feb 2014 03:00:39 -0800 (PST) +Received: from omta02.westchester.pa.mail.comcast.net ([76.96.62.19]) + by qmta03.westchester.pa.mail.comcast.net with comcast + id Mmxo1n0010QuhwU53n0fRW; Mon, 03 Feb 2014 11:00:39 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by omta02.westchester.pa.mail.comcast.net with comcast + id Mn0e1n008152l3L3Nn0eXh; Mon, 03 Feb 2014 11:00:39 +0000 +Received: from mjolnir.tremily.us (unknown [192.168.0.140]) + by odin.tremily.us (Postfix) with ESMTPS id E738EFB4D43; + Mon, 3 Feb 2014 03:00:37 -0800 (PST) +Received: (nullmailer pid 680 invoked by uid 1000); + Mon, 03 Feb 2014 10:59:40 -0000 +From: "W. Trevor King" +To: notmuch@notmuchmail.org +Subject: [PATCH 02/17] nmbug-status: Use email.utils instead of rfc822 +Date: Mon, 3 Feb 2014 02:59:20 -0800 +Message-Id: + +X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1 +In-Reply-To: +References: +In-Reply-To: +References: +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; + s=q20121106; t=1391425239; + bh=MSPQvFkXROxe4kd3DfB67nEC6G5pbh8GAGl/oeKkuTw=; + h=Received:Received:Received:Received:From:To:Subject:Date: + Message-Id; + b=PGH2llgfdIHSLrhcfBRwPXSBULn3GYFpvfmu85t5gCc2g0YaFIDnL9boKTAGE6rrn + DkJxBJioU7/dmDIOA4Kswtkspe/JvUqKW27jAjb3BqLJ4BSvMhfYYsYHktxXowYJC/ + KcUQEXrTf2pxkUk31uOb77hXsUv7icLDvxLwXTHtMoUykjti5rygGcWJsLL2leMC9U + p3000mO9WkFjXQsNDDPmeVyKFimBqccDdFnwHLk0A83Z3M18qC8+6ScT2Z5x2GGND+ + GhtVLMT/Sbm7gSTAZGsaGFxGKY9YFs4/UoZkTF2dTyWXoOYITj5WR3jjK7dVQwDaq+ + xivF+d9YHaMLg== +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 03 Feb 2014 11:00:47 -0000 + +rfc822 has been deprecated since Python 2.3, and it's gone in +Python 3 [1]. + +[1]: http://docs.python.org/2/library/rfc822.html +--- + devel/nmbug/nmbug-status | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status +index b1feee9..6525176 100755 +--- a/devel/nmbug/nmbug-status ++++ b/devel/nmbug/nmbug-status +@@ -9,7 +9,7 @@ + from __future__ import print_function + + import datetime +-import rfc822 ++import email.utils + import urllib + import json + import argparse +@@ -128,7 +128,7 @@ def print_view(title, query, comment): + val = str.join(' ', val.split(None)[1:4]) + val = str(datetime.datetime.strptime(val, '%d %b %Y').date()) + elif header == 'from': +- (val, addr) = rfc822.parseaddr(val) ++ (val, addr) = email.utils.parseaddr(val) + if val == '': + val = addr.split('@')[0] + +-- +1.8.5.2.8.g0f6c0d1 +