summaryrefslogtreecommitdiff
path: root/alot/helper.py
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2018-07-14 19:05:17 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2018-07-16 11:38:36 +0200
commitacf627f3c6a11b462d8cdad21b8e8e82c6b200e5 (patch)
treed12c4ac58d55dba14d9de726ae933b7b9533255b /alot/helper.py
parentdec79d0efac45e82a230d78693114b26e9070347 (diff)
alot/helper: parse_mailto: unquote is in urllib.parse in Python 3
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Diffstat (limited to 'alot/helper.py')
-rw-r--r--alot/helper.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/alot/helper.py b/alot/helper.py
index 919793d8..70d375c8 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -541,12 +541,12 @@ def parse_mailto(mailto_str):
:rtype: tuple(dict(str->list(str)), str)
"""
if mailto_str.startswith('mailto:'):
- import urllib
+ import urllib.parse
to_str, parms_str = mailto_str[7:].partition('?')[::2]
headers = {}
body = u''
- to = urllib.unquote(to_str)
+ to = urllib.parse.unquote(to_str)
if to:
headers['To'] = [to]
@@ -554,9 +554,9 @@ def parse_mailto(mailto_str):
key, value = s.partition('=')[::2]
key = key.capitalize()
if key == 'Body':
- body = urllib.unquote(value)
+ body = urllib.parse.unquote(value)
elif value:
- headers[key] = [urllib.unquote(value)]
+ headers[key] = [urllib.parse.unquote(value)]
return (headers, body)
else:
return (None, None)