mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
more stuff and things
This commit is contained in:
+4
-1
@@ -79,13 +79,16 @@ is_solaris = ('solar==' in str(sys.platform).lower()) # Complete guess.
|
||||
|
||||
|
||||
if is_py2:
|
||||
from urlparse import urlparse, urlunparse, urljoin, urlsplit, quote, unquote
|
||||
from urllib import quote, unquote
|
||||
from urlparse import urlparse, urlunparse, urljoin, urlsplit
|
||||
from urllib2 import parse_http_list
|
||||
import cookielib
|
||||
from .packages.oreos.monkeys import SimpleCookie
|
||||
|
||||
|
||||
elif is_py3:
|
||||
from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote
|
||||
from urllib.request import parse_http_list
|
||||
from http import cookiejar as cookielib
|
||||
from http.cookies import SimpleCookie
|
||||
|
||||
|
||||
+3
-7
@@ -8,16 +8,12 @@ This module contains the primary objects that power Requests.
|
||||
"""
|
||||
|
||||
import os
|
||||
import urllib.request, urllib.parse, urllib.error
|
||||
|
||||
# from urlparse import urlparse, urlunparse, urljoin, urlsplit
|
||||
from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode
|
||||
from datetime import datetime
|
||||
|
||||
from .hooks import dispatch_hook, HOOKS
|
||||
from .structures import CaseInsensitiveDict
|
||||
from .status_codes import codes
|
||||
# from .packages import oreos
|
||||
|
||||
from .auth import HTTPBasicAuth, HTTPProxyAuth
|
||||
from .packages.urllib3.response import HTTPResponse
|
||||
from .packages.urllib3.exceptions import MaxRetryError
|
||||
@@ -32,6 +28,8 @@ from .utils import (
|
||||
get_encoding_from_headers, stream_decode_response_unicode,
|
||||
stream_decompress, guess_filename, requote_path, dict_from_string)
|
||||
|
||||
from .compat import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote
|
||||
|
||||
# Import chardet if it is available.
|
||||
try:
|
||||
import chardet
|
||||
@@ -356,8 +354,6 @@ class Request(object):
|
||||
if not path:
|
||||
path = '/'
|
||||
|
||||
from urllib.parse import quote, unquote
|
||||
|
||||
path = quote(path.encode('utf-8'))
|
||||
url.append(path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user