From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B8C486DE0183 for ; Sun, 4 Feb 2018 20:20:12 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=-0.007] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8YvnQxbVgQqp for ; Sun, 4 Feb 2018 20:20:12 -0800 (PST) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 311C56DE020D for ; Sun, 4 Feb 2018 20:20:11 -0800 (PST) Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net [108.58.6.98]) by che.mayfirst.org (Postfix) with ESMTPSA id 5A51DF99F for ; Sun, 4 Feb 2018 23:20:10 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id B0883219EF; Sun, 4 Feb 2018 23:20:05 -0500 (EST) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH 08/11] nmweb: use urllib.quote_plus() as plain quote_plus() Date: Sun, 4 Feb 2018 23:19:56 -0500 Message-Id: <20180205041959.22066-9-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180205041959.22066-1-dkg@fifthhorseman.net> References: <20180205041959.22066-1-dkg@fifthhorseman.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.24 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, 05 Feb 2018 04:20:12 -0000 This will make it easier to import quote_plus from urllib.parse, which is where it is in python3. --- contrib/notmuch-web/nmweb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/notmuch-web/nmweb.py b/contrib/notmuch-web/nmweb.py index 0217fce0..31351399 100755 --- a/contrib/notmuch-web/nmweb.py +++ b/contrib/notmuch-web/nmweb.py @@ -2,7 +2,7 @@ from __future__ import absolute_import -import urllib +from urllib import quote_plus from datetime import datetime from mailbox import MaildirMessage import mimetypes @@ -34,7 +34,7 @@ def urlencode_filter(s): if type(s) == 'Markup': s = s.unescape() s = s.encode('utf8') - s = urllib.quote_plus(s) + s = quote_plus(s) return Markup(s) env.filters['url'] = urlencode_filter @@ -69,7 +69,7 @@ class search: redir = True terms += ' %s..%s' % (afters, befores) if redir: - raise web.seeother('/search/%s' % urllib.quote_plus(terms)) + raise web.seeother('/search/%s' % quote_plus(terms)) web.header('Content-type', 'text/html') web.header('Transfer-Encoding', 'chunked') db = Database() @@ -107,7 +107,7 @@ def show_msgs(msgs): frm = msg.get_header('From') frm = mailto_addrs(frm) subj = msg.get_header('Subject') - lnk = urllib.quote_plus(msg.get_message_id()) + lnk = quote_plus(msg.get_message_id()) rs = show_msgs(msg.get_replies()) r += '
  • %s—%s %s
  • ' % ( red, frm, prefix, lnk, subj, rs) -- 2.15.1