From: W. Trevor King Date: Mon, 3 Feb 2014 10:59:27 +0000 (+1600) Subject: [PATCH 09/17] nmbug-status: Add a Python-3-compatible urllib.parse.quote import X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e172c3d759710d1b98075e449c85e85372e56b3f;p=notmuch-archives.git [PATCH 09/17] nmbug-status: Add a Python-3-compatible urllib.parse.quote import --- diff --git a/93/05f43865d9fc9ae4f44391165151e94b6fb86b b/93/05f43865d9fc9ae4f44391165151e94b6fb86b new file mode 100644 index 000000000..e0a0698b5 --- /dev/null +++ b/93/05f43865d9fc9ae4f44391165151e94b6fb86b @@ -0,0 +1,109 @@ +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 18F5D429E58 + for ; Mon, 3 Feb 2014 03:03:04 -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 7TqG90BmMC7x for ; + Mon, 3 Feb 2014 03:02:56 -0800 (PST) +Received: from qmta01.westchester.pa.mail.comcast.net + (qmta01.westchester.pa.mail.comcast.net [76.96.62.16]) + by olra.theworths.org (Postfix) with ESMTP id 61003429E32 + for ; Mon, 3 Feb 2014 03:02:42 -0800 (PST) +Received: from omta07.westchester.pa.mail.comcast.net ([76.96.62.59]) + by qmta01.westchester.pa.mail.comcast.net with comcast + id Mn2i1n0011GhbT851n2i2b; Mon, 03 Feb 2014 11:02:42 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by omta07.westchester.pa.mail.comcast.net with comcast + id Mn0h1n00U152l3L3Tn0iPX; Mon, 03 Feb 2014 11:00:42 +0000 +Received: from mjolnir.tremily.us (unknown [192.168.0.140]) + by odin.tremily.us (Postfix) with ESMTPS id 9644EFB4D52; + Mon, 3 Feb 2014 03:00:41 -0800 (PST) +Received: (nullmailer pid 696 invoked by uid 1000); + Mon, 03 Feb 2014 10:59:41 -0000 +From: "W. Trevor King" +To: notmuch@notmuchmail.org +Subject: [PATCH 09/17] nmbug-status: Add a Python-3-compatible + urllib.parse.quote import +Date: Mon, 3 Feb 2014 02:59:27 -0800 +Message-Id: + <80d27fa376ab1c214396c24fb0268a96293a4d87.1391424512.git.wking@tremily.us> +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=1391425362; + bh=+RYjUyYKWkd/LXfnYi2JOZZTp5ecx1cOBgcyXSpm2TU=; + h=Received:Received:Received:Received:From:To:Subject:Date: + Message-Id; + b=lcImJa3feHFABBSQR3ZKZ4rtsaLJuhhawDydqkzngVV/7snhQytItWPIWRh6LFL+h + QwdYrwyILkAqtbW3VvNxMxmB+p6wTrV1FKSAE28RxRlAocCIR+ELqFndYH4t9HEzDG + /yHtCBHM+HvPOKMRprfl1nqYQlND4R31EM66UQeDt3e/a6yVkL9M6JTKdQBXtfUMHz + IDuZ/JOS3Qvy68yW2UGvB4N90chBX7iZBaq/avxWyeuQRStUgkAeyrNsiMuYQsJRIF + ugAegFt5EvtAilsAQrY8qwvPSYvRAh4hndQqg429QhWrU/VbpeldJWtib/XGdraTra + HxCPaWr5NEdnQ== +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:03:04 -0000 + +Python 2's urllib.quote [1] has moved to urllib.parse.quote in Python +3 [2]. + +[1]: http://docs.python.org/2/library/urllib.html#urllib.quote +[2]: http://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote +--- + devel/nmbug/nmbug-status | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status +index 3aa83b6..22b6b10 100755 +--- a/devel/nmbug/nmbug-status ++++ b/devel/nmbug/nmbug-status +@@ -12,7 +12,10 @@ import codecs + import datetime + import email.utils + import locale +-import urllib ++try: # Python 3 ++ from urllib.parse import quote ++except ImportError: # Python 2 ++ from urllib import quote + import json + import argparse + import os +@@ -124,8 +127,8 @@ def print_view(database, title, query, comment, + + if output_format == 'html': + +- out['subject'] = '%s' \ +- % (urllib.quote(mid), out['subject']) ++ out['subject'] = '%s' % ( ++ quote(mid), out['subject']) + + lines.append(' %s' % out['date']) + lines.append('%s' % out['id']) +-- +1.8.5.2.8.g0f6c0d1 +