move config around a bit

This commit is contained in:
Kenneth Reitz
2012-03-07 16:25:27 -08:00
parent 09b6aef835
commit 54b2cb0b27
4 changed files with 16 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
workon r
+4 -3
View File
@@ -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')
+7
View File
@@ -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
+4
View File
@@ -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()