mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
move config around a bit
This commit is contained in:
+4
-3
@@ -65,6 +65,9 @@ class Request(object):
|
||||
verify=None,
|
||||
session=None):
|
||||
|
||||
#: Dictionary of configurations for this request.
|
||||
self.config = dict(config or [])
|
||||
|
||||
#: Float describes the timeout of the request.
|
||||
# (Use socket.setdefaulttimeout() as fallback)
|
||||
self.timeout = timeout
|
||||
@@ -112,9 +115,6 @@ class Request(object):
|
||||
#: CookieJar to attach to :class:`Request <Request>`.
|
||||
self.cookies = dict(cookies or [])
|
||||
|
||||
#: Dictionary of configurations for this request.
|
||||
self.config = dict(config or [])
|
||||
|
||||
#: True if Request has been sent.
|
||||
self.sent = False
|
||||
|
||||
@@ -320,6 +320,7 @@ class Request(object):
|
||||
if not path:
|
||||
path = '/'
|
||||
|
||||
|
||||
if is_py2:
|
||||
if isinstance(scheme, str):
|
||||
scheme = scheme.encode('utf-8')
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import requests
|
||||
|
||||
s = requests.session()
|
||||
s.config['encode_urls'] = False
|
||||
|
||||
r = s.get('http://localhost:7077/get?me=\"')
|
||||
print r.text
|
||||
@@ -49,6 +49,10 @@ class RequestsTestSuite(unittest.TestCase):
|
||||
requests.post('http://www.google.com/', data=utf8_string)
|
||||
|
||||
|
||||
def test_unicode_error(self):
|
||||
url = u'http://blip.fm/~1abvfu'
|
||||
requests.get(url)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user