Skip to content
Myr

Merge pull request #1412 from t-8ch/update_urllib3

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

update urllib3 to 60ba176f5d

authored by Kenneth Reitz · committed by Kenneth Reitz · parents e63e68e, 2ed976e · Browse files · 7 files+52 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

7 files+52 added−6 removed

  • other:+52 added−6 removed

7 files+52 added−6 removed

modified:requests/packages/urllib3/contrib/ntlmpool.py+1 added-1 removed
31 unmodified lines
3233 def __init__(self, user, pw, authurl, *args, **kwargs):34 """35 authurl is a random URL on the server that is protected by NTLM.36 user is the Windows user, probably in the DOMAIN\username format.36 user is the Windows user, probably in the DOMAIN\\username format.37 pw is the password for the user.38 """39 super(NTLMConnectionPool, self).__init__(*args, **kwargs)40 self.authurl = authurl
80 unmodified lines
modified:requests/packages/urllib3/contrib/pyopenssl.py+3 added
113 unmodified lines
114115 def sendall(self, data):116 return self.connection.sendall(data)117118 def close(self):119 return self.connection.shutdown()120121 def getpeercert(self, binary_form=False):122 x509 = self.connection.get_peer_certificate()123 if not x509:124 raise ssl.SSLError('')
46 unmodified lines
modified:requests/packages/urllib3/connectionpool.py+2 added-1 removed
108 unmodified lines
109 if resolved_cert_reqs != ssl.CERT_NONE:110 if self.assert_fingerprint:111 assert_fingerprint(self.sock.getpeercert(binary_form=True),112 self.assert_fingerprint)113 else:113 elif self.assert_hostname is not False:114 match_hostname(self.sock.getpeercert(),115 self.assert_hostname or self.host)116117## Pool objects
394 unmodified lines
512 instead of :class:`httplib.HTTPSConnection`.513514 :class:`.VerifiedHTTPSConnection` uses one of ``assert_fingerprint``,515 ``assert_hostname`` and ``host`` in this order to verify connections.516 If ``assert_hostname`` is False, no verification is done.517518 The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs`` and519 ``ssl_version`` are only used if :mod:`ssl` is available and are fed into520 :meth:`urllib3.util.ssl_wrap_socket` to upgrade the connection socket
78 unmodified lines
modified:requests/packages/urllib3/filepost.py+1 added-1 removed
1# urllib3/filepost.py2# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3#4# This module is part of urllib3 and is released under5# the MIT License: http://www.opensource.org/licenses/mit-license.php6
92 unmodified lines
modified:requests/packages/urllib3/poolmanager.py+9 added
4 unmodified lines
5# the MIT License: http://www.opensource.org/licenses/mit-license.php67import logging89try: # Python 310 from urllib.parse import urljoin11except ImportError:12 from urlparse import urljoin1314from ._collections import RecentlyUsedContainer15from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool16from .connectionpool import connection_from_url, port_by_scheme17from .request import RequestMethods
131 unmodified lines
149 redirect_location = redirect and response.get_redirect_location()150 if not redirect_location:151 return response152153 # Support relative URLs for redirecting.154 redirect_location = urljoin(url, redirect_location)155156 # RFC 2616, Section 10.3.4157 if response.status == 303:158 method = 'GET'159160 log.info("Redirecting %s -> %s" % (url, redirect_location))
41 unmodified lines
modified:requests/packages/urllib3/request.py+1 added-1 removed
28 unmodified lines
29 :meth:`.request_encode_url` is for sending requests whose fields are encoded30 in the URL (such as GET, HEAD, DELETE).3132 :meth:`.request_encode_body` is for sending requests whose fields are33 encoded in the *body* of the request using multipart or www-orm-urlencoded33 encoded in the *body* of the request using multipart or www-form-urlencoded34 (such as for POST, PUT, PATCH).3536 :meth:`.request` is for making any kind of request, it will look up the37 appropriate encoding format and use one of the above two methods to make
105 unmodified lines
modified:requests/packages/urllib3/response.py+35 added-2 removed
1# urllib3/response.py2# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3#4# This module is part of urllib3 and is released under5# the MIT License: http://www.opensource.org/licenses/mit-license.php678import logging9import zlib10import io1112from .exceptions import DecodeError13from .packages.six import string_types as basestring, binary_type14
33 unmodified lines
4849 return DeflateDecoder()505151class HTTPResponse(object):52class HTTPResponse(io.IOBase):53 """54 HTTP Response container.5556 Backwards-compatible to httplib's HTTPResponse but the response ``body`` is
182 unmodified lines
239 return self.headers240241 def getheader(self, name, default=None):242 return self.headers.get(name, default)243244 # Overrides from io.IOBase245 def close(self):246 if not self.closed:247 self._fp.close()248249 @property250 def closed(self):251 if self._fp is None:252 return True253 elif hasattr(self._fp, 'closed'):254 return self._fp.closed255 elif hasattr(self._fp, 'isclosed'): # Python 2256 return self._fp.isclosed()257 else:258 return True259260 def fileno(self):261 if self._fp is None:262 raise IOError("HTTPResponse has no file to get a fileno from")263 elif hasattr(self._fp, "fileno"):264 return self._fp.fileno()265 else:266 raise IOError("The file-like object this HTTPResponse is wrapped "267 "around has no file descriptor")268269 def flush(self):270 if self._fp is not None and hasattr(self._fp, 'flush'):271 return self._fp.flush()272273 def readable(self):274 return True