mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
nmbug-status: Add a Python-3-compatible urllib.parse.quote import
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
This commit is contained in:
parent
a6ff03df3f
commit
7b7a83cc32
1 changed files with 6 additions and 3 deletions
|
@ -12,7 +12,10 @@ import codecs
|
||||||
import datetime
|
import datetime
|
||||||
import email.utils
|
import email.utils
|
||||||
import locale
|
import locale
|
||||||
import urllib
|
try: # Python 3
|
||||||
|
from urllib.parse import quote
|
||||||
|
except ImportError: # Python 2
|
||||||
|
from urllib import quote
|
||||||
import json
|
import json
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
@ -124,8 +127,8 @@ def print_view(database, title, query, comment,
|
||||||
|
|
||||||
if output_format == 'html':
|
if output_format == 'html':
|
||||||
|
|
||||||
out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' \
|
out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' % (
|
||||||
% (urllib.quote(mid), out['subject'])
|
quote(mid), out['subject'])
|
||||||
|
|
||||||
lines.append(' <tr><td>%s' % out['date'])
|
lines.append(' <tr><td>%s' % out['date'])
|
||||||
lines.append('</td><td>%s' % out['id'])
|
lines.append('</td><td>%s' % out['id'])
|
||||||
|
|
Loading…
Reference in a new issue