Update urllib3 to 43b5b2b452e4344374de7d08ececcca495079b8d
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Ian Cordasco · committed by Ian Cordasco · parent 39e49e5 · Browse files · 4 files·+30 added−15 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+30 added−15 removed
- other:+30 added−15 removed
Provenance
- Commit
a0790f3- Tree
18d83e5- Author
Ian Cordasco <graffatcolmingov@gmail.com>- Committer
Ian Cordasco <graffatcolmingov@gmail.com>- Parent
39e49e5
4 files changed+30 added−15 removed
modified:requests/packages/urllib3/util/ssl_.py+10 added-1 removed
1 from binascii import hexlify, unhexlify2 from hashlib import md5, sha1, sha2563 4-from ..exceptions import SSLError4+from ..exceptions import SSLError, InsecurePlatformWarning5 6 7 SSLContext = None8 HAS_SNI = False9 create_default_context = None10 11 import errno12 import ssl13+import warnings14 15 try: # Test for SSL features16 from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv2317 from ssl import HAS_SNI # Has SNI?51 unmodified lines69 )70 self.ciphers = cipher_suite71 72 def wrap_socket(self, socket, server_hostname=None):73+ warnings.warn(74+ 'A true SSLContext object is not available. This prevents '75+ 'urllib3 from configuring SSL appropriately and may cause '76+ 'certain SSL connections to fail. For more information, see '77+ 'https://urllib3.readthedocs.org/en/latest/security.html'78+ '#insecureplatformwarning.',79+ InsecurePlatformWarning80+ )81 kwargs = {82 'keyfile': self.keyfile,83 'certfile': self.certfile,84 'ca_certs': self.ca_certs,182 unmodified linesmodified:requests/packages/urllib3/__init__.py+1 added-1 removed
2 unmodified lines3 """4 5 __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'6 __license__ = 'MIT'7-__version__ = 'dev'7+__version__ = '1.10.2'8 9 10 from .connectionpool import (11 HTTPConnectionPool,55 unmodified linesmodified:requests/packages/urllib3/_collections.py+14 added-13 removed
18 unmodified lines19 20 __all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']21 22 23-MULTIPLE_HEADERS_ALLOWED = frozenset(['cookie', 'set-cookie', 'set-cookie2'])24-23 _Null = object()24 25 26 class RecentlyUsedContainer(MutableMapping):113 unmodified lines140 141 def __init__(self, headers=None, **kwargs):142 dict.__init__(self)143 if headers is not None:144+ if isinstance(headers, HTTPHeaderDict):145+ self._copy_from(headers)146+ else:146- self.extend(headers)147+ self.extend(headers)148 if kwargs:149 self.extend(kwargs)150 151 def __setitem__(self, key, val):71 unmodified lines223 # If already several items got inserted, we have a list224 vals.append(val)225 else:226 # vals should be a tuple then, i.e. only one item so far226- if key_lower in MULTIPLE_HEADERS_ALLOWED:227- # Need to convert the tuple to list for further extension228- _dict_setitem(self, key_lower, [vals[0], vals[1], val])227+ # Need to convert the tuple to list for further extension228+ _dict_setitem(self, key_lower, [vals[0], vals[1], val])229- else:230- _dict_setitem(self, key_lower, new_vals)229 230 def extend(*args, **kwargs):231 """Generic import function for any type of header-like object.232 Adapted version of MutableMapping.update in order to insert items40 unmodified lines273 274 def __repr__(self):275 return "%s(%s)" % (type(self).__name__, dict(self.itermerged()))276 279- def copy(self):280- clone = type(self)()281- for key in self:282- val = _dict_getitem(self, key)277+ def _copy_from(self, other):278+ for key in other:279+ val = _dict_getitem(other, key)280 if isinstance(val, list):281 # Don't need to convert tuples282 val = list(val)286- _dict_setitem(clone, key, val)283+ _dict_setitem(self, key, val)284+285+ def copy(self):286+ clone = type(self)()287+ clone._copy_from(self)288 return clone289 290 def iteritems(self):291 """Iterate over all header lines, including duplicate ones."""29 unmodified linesmodified:requests/packages/urllib3/exceptions.py+5 added
155 unmodified lines156 157 class SystemTimeWarning(SecurityWarning):158 "Warned when system time is suspected to be wrong"159 pass160+161+162+class InsecurePlatformWarning(SecurityWarning):163+ "Warned when certain SSL configuration is not available on a platform."164+ pass