Skip to content
Myr

Merge branch 'develop' into merge/xero

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parents e7b8e93, 9e45d20 · Browse files · 4 files+29 added−14 removed
This commit

State

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

Diff stats

4 files+29 added−14 removed

  • other:+29 added−14 removed

4 files+29 added−14 removed

modified:requests/packages/poster/streaminghttp.py+7 added-5 removed
179 unmodified lines
180 "No Content-Length specified for iterable body")181 return urllib2.HTTPSHandler.do_request_(self, req)182183184def get_handlers():185 handlers = [StreamingHTTPHandler, StreamingHTTPRedirectHandler]186 if hasattr(httplib, "HTTPS"):187 handlers.append(StreamingHTTPSHandler)188 return handlers189 190def register_openers():191 """Register the streaming http handlers in the global urllib2 default192 opener object.193194 Returns the created OpenerDirector object."""189 handlers = [StreamingHTTPHandler, StreamingHTTPRedirectHandler]190 if hasattr(httplib, "HTTPS"):191 handlers.append(StreamingHTTPSHandler)195 opener = urllib2.build_opener(*get_handlers())196193 opener = urllib2.build_opener(*handlers)194197 urllib2.install_opener(opener)198199 return opener
modified:requests/core.py+6 added-9 removed
14 unmodified lines
15import urllib216from urllib2 import HTTPError1718from .packages.poster.encode import multipart_encode19from .packages.poster.streaminghttp import register_openers19from .packages.poster.streaminghttp import register_openers, get_handlers202122__title__ = 'requests'23__version__ = '0.2.5'
84 unmodified lines
108 auth_manager.add_auth(self.url, self.auth)109110 _handlers.append(self.auth.handler)111112 if self.cookiejar:113 cookie_handler = urllib2.HTTPCookieProcessor(cookiejar)114 _handlers.append(cookie_handler)115 if _handlers:112 _handlers.extend(get_handlers())113 opener = urllib2.build_opener(*_handlers)114 return opener.open115 else:116 return urllib2.urlopen117118119 def _build_response(self, resp):120 """Build internal Response object from given response."""124125 self.response.status_code = resp.code126 self.response.headers = resp.info().dict or resp.headers121 122 self.response.status_code = getattr(resp, 'code', None)123 self.response.headers = getattr(resp.info(), 'dict', None)124 self.response.url = getattr(resp, 'url', None)125 self.response.content = resp.read()128 self.response.url = resp.url126127128 def send(self, anyway=False):129 """Sends the request. Returns True of successful, false if not.
313 unmodified lines
modified:AUTHORS+2 added
10 unmodified lines
11```````````````````````1213- Various Pocoo Members14- Chris Adams15- Flavio Percoco Premoli16- Dj Gilcrease
added:HACKING+14 added
1Where possible, please follow PEP8 with regard to coding style. Sometimes the line 2length restriction is too hard to follow, so don't bend over backwards there.34Triple-quotes should always be """, single quotes are ' unless using "5would result in less escaping within the string.67All modules, functions, and methods should be well documented reStructuredText for 8Sphinx AutoDoc.910All functionality should be available in pure Python. Optional C (via Cython)11implementations may be written for performance reasons, but should never12replace the Python implementation.1314Lastly, don't take yourself too seriously :)