Permalink
Browse files

move config around a bit

  • Loading branch information...
1 parent 09b6aef commit 54b2cb0b2744470dce8801bfe76e3041eadb336f @kennethreitz kennethreitz committed Mar 8, 2012
Showing with 16 additions and 3 deletions.
  1. +1 −0 .env
  2. +4 −3 requests/models.py
  3. +7 −0 test.py
  4. +4 −0 tests/test_requests_ext.py
View
1 .env
@@ -0,0 +1 @@
+workon r
View
@@ -65,6 +65,9 @@ def __init__(self,
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 @@ def __init__(self,
#: 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 @@ def full_url(self):
if not path:
path = '/'
+
if is_py2:
if isinstance(scheme, str):
scheme = scheme.encode('utf-8')
View
@@ -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 @@ def test_binary_post(self):
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()

0 comments on commit 54b2cb0

Please sign in to comment.