Merge pull request #1500 from gavrie/master
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Update urllib3 to d89d508
authored by Kenneth Reitz · committed by Kenneth Reitz · parents d5fd3d3, ea2b639 · Browse files · 4 files·+22 added−13 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+22 added−13 removed
- other:+22 added−13 removed
Provenance
- Commit
22701d1- Tree
1df38b9- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent 1
d5fd3d3- Parent 2
ea2b639
4 files changed+22 added−13 removed
modified:requests/packages/urllib3/connectionpool.py+7 added-7 removed
24 unmodified lines25 26 27 try: # Compiled with SSL?28 HTTPSConnection = object29- BaseSSLError = None29+30+ class BaseSSLError(BaseException):31+ pass32+33 ssl = None34 35 try: # Python 336 from http.client import HTTPSConnection117 unmodified lines154 as a valid HTTP/1.0 or 1.1 status line, passed into155 :class:`httplib.HTTPConnection`.156 157 :param timeout:155- Socket timeout for each individual connection, can be a float. None156- disables timeout.158+ Socket timeout in seconds for each individual connection, can be159+ a float. None disables timeout.160 161 :param maxsize:162 Number of connections to save that can be reused. More than 1 is useful163 in multithreaded situations. If ``block`` is set to false, more214 unmodified lines378 use the pool on an HTTP proxy and request foreign hosts.379 380 :param timeout:381 If specified, overrides the default timeout for this one request.382+ It may be a float (in seconds).383 384 :param pool_timeout:385 If set and the pool is set to block=True, then this method will386 block for ``pool_timeout`` seconds and raise EmptyPoolError if no26 unmodified lines413 release_conn = response_kw.get('preload_content', True)414 415 # Check host416 if assert_same_host and not self.is_same_host(url):413- host = "%s://%s" % (self.scheme, self.host)414- if self.port:415- host = "%s:%d" % (host, self.port)416-417 raise HostChangedError(self, url, retries - 1)418 419 conn = None420 178 unmodified linesmodified:requests/packages/urllib3/poolmanager.py+3 added-3 removed
179 unmodified lines180 headers. Only sets headers not provided by the user.181 """182 headers_ = {'Accept': '*/*'}183 184- host = parse_url(url).host185- if host:186- headers_['Host'] = host184+ netloc = parse_url(url).netloc185+ if netloc:186+ headers_['Host'] = netloc187 188 if headers:189 headers_.update(headers)190 12 unmodified linesmodified:requests/packages/urllib3/response.py+5 added-3 removed
183 unmodified lines184 185 try:186 if decode_content and self._decoder:187 data = self._decoder.decompress(data)188- except (IOError, zlib.error):189- raise DecodeError("Received response with content-encoding: %s, but "190- "failed to decode it." % content_encoding)188+ except (IOError, zlib.error) as e:189+ raise DecodeError(190+ "Received response with content-encoding: %s, but "191+ "failed to decode it." % content_encoding,192+ e)193 194 if flush_decoder and self._decoder:195 buf = self._decoder.decompress(binary_type())196 data += buf + self._decoder.flush()104 unmodified linesmodified:requests/packages/urllib3/util.py+7 added
58 unmodified lines59 uri += '?' + self.query60 61 return uri62 63+ @property64+ def netloc(self):65+ """Network location including host and port"""66+ if self.port:67+ return '%s:%d' % (self.host, self.port)68+ return self.host69 70+71 def split_first(s, delims):72 """73 Given a string and an iterable of delimiters, split on the first found74 delimiter. Return two split parts and the matched delimiter.325 unmodified lines