Skip to content
Myr

small workaround for issue #7

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

authored by Flavio Percoco Premoli · committed by Flavio Percoco Premoli · parent e788ca7 · Browse files · 2 files+9 added−6 removed
This commit

State

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

Diff stats

2 files+9 added−6 removed

  • other:+9 added−6 removed

2 files+9 added−6 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+2 added-1 removed
28 unmodified lines
29 except ImportError:30 pass3132from .packages.poster.encode import multipart_encode33from .packages.poster.streaminghttp import register_openers33from .packages.poster.streaminghttp import register_openers, get_handlers343536__title__ = 'requests'37__version__ = '0.2.4'
85 unmodified lines
123124 cookie_handler = urllib2.HTTPCookieProcessor(cookiejar)125 _handlers.append(cookie_handler)126127 _handlers += get_handlers()128 opener = urllib2.build_opener(*_handlers)129 return opener.open130131 else:
304 unmodified lines