Skip to content
Myr

Merge remote-tracking branch 'upstream/develop' into develop

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Chris Dary · committed by Chris Dary · parents e264582, 2f91d8e · Browse files · 10 files+27 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

10 files+27 added−9 removed

  • tests:+5 added−1 removed
  • other:+22 added−8 removed

10 files+27 added−9 removed

modified:requests/__init__.py+2 added-2 removed
13 unmodified lines
1415"""1617__title__ = 'requests'18__version__ = '0.10.6'19__build__ = 0x00100618__version__ = '0.10.7'19__build__ = 0x00100720__author__ = 'Kenneth Reitz'21__license__ = 'ISC'22__copyright__ = 'Copyright 2012 Kenneth Reitz'23
10 unmodified lines
modified:requests/defaults.py+2 added
15 unmodified lines
16:danger_mode: If true, Requests will raise errors immediately.17:safe_mode: If true, Requests will catch all errors.18:pool_maxsize: The maximium size of an HTTP connection pool.19:pool_connections: The number of active HTTP connection pools to use.20:encode_uri: If true, URIs will automatically be percent-encoded.21"""2223SCHEMAS = ['http', 'https']24
15 unmodified lines
40defaults['max_retries'] = 041defaults['danger_mode'] = False42defaults['safe_mode'] = False43defaults['keep_alive'] = True44defaults['encode_uri'] = True4546
modified:requests/models.py+7 added-5 removed
63 unmodified lines
64 _poolmanager=None,65 verify=None,66 session=None):6768 #: Dictionary of configurations for this request.69 self.config = dict(config or [])7071 #: Float describes the timeout of the request.72 # (Use socket.setdefaulttimeout() as fallback)73 self.timeout = timeout74
39 unmodified lines
114115 #: CookieJar to attach to :class:`Request <Request>`.116 self.cookies = dict(cookies or [])117115 #: Dictionary of configurations for this request.116 self.config = dict(config or [])117118 #: True if Request has been sent.119 self.sent = False120121 #: Event-handling hooks.
199 unmodified lines
321322 if not path:323 path = '/'324325326 if is_py2:327 if isinstance(scheme, str):328 scheme = scheme.encode('utf-8')329 if isinstance(netloc, str):
14 unmodified lines
344 url = '%s&%s' % (url, self._enc_params)345 else:346 url = '%s?%s' % (url, self._enc_params)347348 if self.config.get('encode_uri', True):347 url = requote_uri(url)349 url = requote_uri(url)350351 return url352353 @property
26 unmodified lines
380381 return self.hooks[event].append(hook)382383 def send(self, anyway=False, prefetch=False):382 """Sends the request. Returns True of successful, false if not.384 """Sends the request. Returns True of successful, False if not.385 If there was an HTTPError during transmission,386 self.response.status_code will contain the HTTPError code.387388 Once a request is successfully sent, `sent` will equal True.
412 unmodified lines
modified:requests/sessions.py+3 added
62 unmodified lines
63 proxies=None,64 hooks=None,65 params=None,66 config=None,67 prefetch=False,68 verify=True):6970 self.headers = headers or {}71 self.cookies = cookies or {}
2 unmodified lines
74 self.proxies = proxies or {}75 self.hooks = hooks or {}76 self.params = params or {}77 self.config = config or {}78 self.prefetch = prefetch79 self.verify = verify8081 for (k, v) in list(defaults.items()):82 self.config.setdefault(k, v)
66 unmodified lines
149 files = {} if files is None else files150 headers = {} if headers is None else headers151 params = {} if params is None else params152 hooks = {} if hooks is None else hooks153 prefetch = self.prefetch or prefetch154155 # use session's hooks as defaults156 for key, cb in list(self.hooks.items()):157 hooks.setdefault(key, cb)
143 unmodified lines
modified:tests/test_requests_ext.py+4 added
47 unmodified lines
48 utf8_string = (u'Smörgås').encode('utf-8')49 requests.post('http://www.google.com/', data=utf8_string)505152 def test_unicode_error(self):53 url = u'http://blip.fm/~1abvfu'54 requests.get(url)5556if __name__ == '__main__':57 unittest.main()58
modified:tests/test_requests.py+1 added-1 removed
72 unmodified lines
7374 def test_path_is_not_double_encoded(self):75 request = requests.Request("http://0.0.0.0/get/test case")7677 assert request.path_url == "/get/test%20case"77 self.assertEqual(request.path_url, "/get/test%20case")7879 def test_HTTP_200_OK_GET(self):80 r = get(httpbin('/get'))81 self.assertEqual(r.status_code, 200)
722 unmodified lines
added:.env+1 added
1workon r
modified:AUTHORS.rst+1 added
82 unmodified lines
83- Cory Benfield (Lukasa)84- Matt Giuca85- Adam Tauber86- Honza Javorek87- Brendan Maguire <maguire.brendan@gmail.com>
modified:HISTORY.rst+5 added
1History2-------340.10.7 (2012-03-07)5+++++++++++++++++++67* `encode_uri` = False890.10.6 (2012-02-25)10+++++++++++++++++++1112* Allow '=' in cookies.
396 unmodified lines
modified:README.rst+1 added-1 removed
1Requests: HTTP for Humans2=========================34.. image:: https://secure.travis-ci.org/kennethreitz/requests.png?branch=master4.. image:: https://secure.travis-ci.org/kennethreitz/requests.png?branch=develop56Requests is an ISC Licensed HTTP library, written in Python, for human7beings.8
68 unmodified lines