diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2008-06-18 20:49:58 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2008-06-18 20:49:58 +0000 |
commit | 671edc4bdfe7652384d23d440268bb862414c4d2 (patch) | |
tree | 4e1cb7e1dd7b200ceb3662b94ab4080bb131f08c /Lib/email | |
parent | bde7b5495aae4e98abf5c61c45505bf69cbfaf70 (diff) | |
download | cpython-671edc4bdfe7652384d23d440268bb862414c4d2.tar.gz |
Make a new urllib package .
It consists of code from urllib, urllib2, urlparse, and robotparser.
The old modules have all been removed. The new package has five
submodules: urllib.parse, urllib.request, urllib.response,
urllib.error, and urllib.robotparser. The urllib.request.urlopen()
function uses the url opener from urllib2.
Note that the unittests have not been renamed for the
beta, but they will be renamed in the future.
Joint work with Senthil Kumaran.
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/utils.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/email/utils.py b/Lib/email/utils.py index 0439aff938..e1d21f6a40 100644 --- a/Lib/email/utils.py +++ b/Lib/email/utils.py @@ -25,6 +25,7 @@ import time import base64 import random import socket +import urllib.parse import warnings from io import StringIO @@ -218,8 +219,7 @@ def encode_rfc2231(s, charset=None, language=None): charset is given but not language, the string is encoded using the empty string for language. """ - import urllib - s = urllib.quote(s, safe='') + s = urllib.parse.quote(s, safe='') if charset is None and language is None: return s if language is None: @@ -234,7 +234,6 @@ def decode_params(params): params is a sequence of 2-tuples containing (param name, string value). """ - import urllib # Copy params so we don't mess with the original params = params[:] new_params = [] @@ -272,7 +271,7 @@ def decode_params(params): # language specifiers at the beginning of the string. for num, s, encoded in continuations: if encoded: - s = urllib.unquote(s) + s = urllib.parse.unquote(s) extended = True value.append(s) value = quote(EMPTYSTRING.join(value)) |