Browse Source

[desktop] Upgrade requests to 2.6.0.

Erick Tryzelaar 10 years ago
parent
commit
c72b52453c
92 changed files with 950 additions and 381 deletions
  1. 0 3
      desktop/core/ext-py/requests-2.5.1/requests/packages/__init__.py
  2. 0 198
      desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/_collections.py
  3. 86 1
      desktop/core/ext-py/requests-2.6.0/HISTORY.rst
  4. 1 1
      desktop/core/ext-py/requests-2.6.0/LICENSE
  5. 0 0
      desktop/core/ext-py/requests-2.6.0/MANIFEST.in
  6. 0 0
      desktop/core/ext-py/requests-2.6.0/NOTICE
  7. 91 6
      desktop/core/ext-py/requests-2.6.0/PKG-INFO
  8. 4 4
      desktop/core/ext-py/requests-2.6.0/README.rst
  9. 4 4
      desktop/core/ext-py/requests-2.6.0/requests/__init__.py
  10. 1 1
      desktop/core/ext-py/requests-2.6.0/requests/adapters.py
  11. 23 8
      desktop/core/ext-py/requests-2.6.0/requests/api.py
  12. 3 1
      desktop/core/ext-py/requests-2.6.0/requests/auth.py
  13. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/cacert.pem
  14. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/certs.py
  15. 0 53
      desktop/core/ext-py/requests-2.6.0/requests/compat.py
  16. 49 40
      desktop/core/ext-py/requests-2.6.0/requests/cookies.py
  17. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/exceptions.py
  18. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/hooks.py
  19. 8 5
      desktop/core/ext-py/requests-2.6.0/requests/models.py
  20. 107 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/__init__.py
  21. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/__init__.py
  22. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/big5freq.py
  23. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/big5prober.py
  24. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/chardetect.py
  25. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/chardistribution.py
  26. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/charsetgroupprober.py
  27. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/charsetprober.py
  28. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/codingstatemachine.py
  29. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/compat.py
  30. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/constants.py
  31. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/cp949prober.py
  32. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/escprober.py
  33. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/escsm.py
  34. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/eucjpprober.py
  35. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euckrfreq.py
  36. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euckrprober.py
  37. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euctwfreq.py
  38. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euctwprober.py
  39. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/gb2312freq.py
  40. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/gb2312prober.py
  41. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/hebrewprober.py
  42. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/jisfreq.py
  43. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/jpcntx.py
  44. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langbulgarianmodel.py
  45. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langcyrillicmodel.py
  46. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langgreekmodel.py
  47. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langhebrewmodel.py
  48. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langhungarianmodel.py
  49. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langthaimodel.py
  50. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/latin1prober.py
  51. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/mbcharsetprober.py
  52. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/mbcsgroupprober.py
  53. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/mbcssm.py
  54. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/sbcharsetprober.py
  55. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/sbcsgroupprober.py
  56. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/sjisprober.py
  57. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/universaldetector.py
  58. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/utf8prober.py
  59. 2 2
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/__init__.py
  60. 320 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/_collections.py
  61. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/connection.py
  62. 54 19
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/connectionpool.py
  63. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/contrib/__init__.py
  64. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/contrib/ntlmpool.py
  65. 5 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/contrib/pyopenssl.py
  66. 5 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/exceptions.py
  67. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/fields.py
  68. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/filepost.py
  69. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/__init__.py
  70. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/ordered_dict.py
  71. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/six.py
  72. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
  73. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
  74. 17 2
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/poolmanager.py
  75. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/request.py
  76. 32 12
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/response.py
  77. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/__init__.py
  78. 1 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/connection.py
  79. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/request.py
  80. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/response.py
  81. 1 1
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/retry.py
  82. 18 6
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/ssl_.py
  83. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/timeout.py
  84. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/url.py
  85. 4 1
      desktop/core/ext-py/requests-2.6.0/requests/sessions.py
  86. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/status_codes.py
  87. 0 0
      desktop/core/ext-py/requests-2.6.0/requests/structures.py
  88. 16 6
      desktop/core/ext-py/requests-2.6.0/requests/utils.py
  89. 0 0
      desktop/core/ext-py/requests-2.6.0/requirements.txt
  90. 0 0
      desktop/core/ext-py/requests-2.6.0/setup.cfg
  91. 14 4
      desktop/core/ext-py/requests-2.6.0/setup.py
  92. 84 3
      desktop/core/ext-py/requests-2.6.0/test_requests.py

+ 0 - 3
desktop/core/ext-py/requests-2.5.1/requests/packages/__init__.py

@@ -1,3 +0,0 @@
-from __future__ import absolute_import
-
-from . import urllib3

+ 0 - 198
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/_collections.py

@@ -1,198 +0,0 @@
-from collections import Mapping, MutableMapping
-try:
-    from threading import RLock
-except ImportError: # Platform-specific: No threads available
-    class RLock:
-        def __enter__(self):
-            pass
-
-        def __exit__(self, exc_type, exc_value, traceback):
-            pass
-
-
-try: # Python 2.7+
-    from collections import OrderedDict
-except ImportError:
-    from .packages.ordered_dict import OrderedDict
-from .packages.six import iterkeys, itervalues
-
-
-__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']
-
-
-_Null = object()
-
-
-class RecentlyUsedContainer(MutableMapping):
-    """
-    Provides a thread-safe dict-like container which maintains up to
-    ``maxsize`` keys while throwing away the least-recently-used keys beyond
-    ``maxsize``.
-
-    :param maxsize:
-        Maximum number of recent elements to retain.
-
-    :param dispose_func:
-        Every time an item is evicted from the container,
-        ``dispose_func(value)`` is called.  Callback which will get called
-    """
-
-    ContainerCls = OrderedDict
-
-    def __init__(self, maxsize=10, dispose_func=None):
-        self._maxsize = maxsize
-        self.dispose_func = dispose_func
-
-        self._container = self.ContainerCls()
-        self.lock = RLock()
-
-    def __getitem__(self, key):
-        # Re-insert the item, moving it to the end of the eviction line.
-        with self.lock:
-            item = self._container.pop(key)
-            self._container[key] = item
-            return item
-
-    def __setitem__(self, key, value):
-        evicted_value = _Null
-        with self.lock:
-            # Possibly evict the existing value of 'key'
-            evicted_value = self._container.get(key, _Null)
-            self._container[key] = value
-
-            # If we didn't evict an existing value, we might have to evict the
-            # least recently used item from the beginning of the container.
-            if len(self._container) > self._maxsize:
-                _key, evicted_value = self._container.popitem(last=False)
-
-        if self.dispose_func and evicted_value is not _Null:
-            self.dispose_func(evicted_value)
-
-    def __delitem__(self, key):
-        with self.lock:
-            value = self._container.pop(key)
-
-        if self.dispose_func:
-            self.dispose_func(value)
-
-    def __len__(self):
-        with self.lock:
-            return len(self._container)
-
-    def __iter__(self):
-        raise NotImplementedError('Iteration over this class is unlikely to be threadsafe.')
-
-    def clear(self):
-        with self.lock:
-            # Copy pointers to all values, then wipe the mapping
-            values = list(itervalues(self._container))
-            self._container.clear()
-
-        if self.dispose_func:
-            for value in values:
-                self.dispose_func(value)
-
-    def keys(self):
-        with self.lock:
-            return list(iterkeys(self._container))
-
-
-class HTTPHeaderDict(MutableMapping):
-    """
-    :param headers:
-        An iterable of field-value pairs. Must not contain multiple field names
-        when compared case-insensitively.
-
-    :param kwargs:
-        Additional field-value pairs to pass in to ``dict.update``.
-
-    A ``dict`` like container for storing HTTP Headers.
-
-    Field names are stored and compared case-insensitively in compliance with
-    RFC 7230. Iteration provides the first case-sensitive key seen for each
-    case-insensitive pair.
-
-    Using ``__setitem__`` syntax overwrites fields that compare equal
-    case-insensitively in order to maintain ``dict``'s api. For fields that
-    compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``
-    in a loop.
-
-    If multiple fields that are equal case-insensitively are passed to the
-    constructor or ``.update``, the behavior is undefined and some will be
-    lost.
-
-    >>> headers = HTTPHeaderDict()
-    >>> headers.add('Set-Cookie', 'foo=bar')
-    >>> headers.add('set-cookie', 'baz=quxx')
-    >>> headers['content-length'] = '7'
-    >>> headers['SET-cookie']
-    'foo=bar, baz=quxx'
-    >>> headers['Content-Length']
-    '7'
-
-    If you want to access the raw headers with their original casing
-    for debugging purposes you can access the private ``._data`` attribute
-    which is a normal python ``dict`` that maps the case-insensitive key to a
-    list of tuples stored as (case-sensitive-original-name, value). Using the
-    structure from above as our example:
-
-    >>> headers._data
-    {'set-cookie': [('Set-Cookie', 'foo=bar'), ('set-cookie', 'baz=quxx')],
-    'content-length': [('content-length', '7')]}
-    """
-
-    def __init__(self, headers=None, **kwargs):
-        self._data = {}
-        if headers is None:
-            headers = {}
-        self.update(headers, **kwargs)
-
-    def add(self, key, value):
-        """Adds a (name, value) pair, doesn't overwrite the value if it already
-        exists.
-
-        >>> headers = HTTPHeaderDict(foo='bar')
-        >>> headers.add('Foo', 'baz')
-        >>> headers['foo']
-        'bar, baz'
-        """
-        self._data.setdefault(key.lower(), []).append((key, value))
-
-    def getlist(self, key):
-        """Returns a list of all the values for the named field. Returns an
-        empty list if the key doesn't exist."""
-        return self[key].split(', ') if key in self else []
-
-    def copy(self):
-        h = HTTPHeaderDict()
-        for key in self._data:
-            for rawkey, value in self._data[key]:
-                h.add(rawkey, value)
-        return h
-
-    def __eq__(self, other):
-        if not isinstance(other, Mapping):
-            return False
-        other = HTTPHeaderDict(other)
-        return dict((k1, self[k1]) for k1 in self._data) == \
-                dict((k2, other[k2]) for k2 in other._data)
-
-    def __getitem__(self, key):
-        values = self._data[key.lower()]
-        return ', '.join(value[1] for value in values)
-
-    def __setitem__(self, key, value):
-        self._data[key.lower()] = [(key, value)]
-
-    def __delitem__(self, key):
-        del self._data[key.lower()]
-
-    def __len__(self):
-        return len(self._data)
-
-    def __iter__(self):
-        for headers in itervalues(self._data):
-            yield headers[0][0]
-
-    def __repr__(self):
-        return '%s(%r)' % (self.__class__.__name__, dict(self.items()))

+ 86 - 1
desktop/core/ext-py/requests-2.5.1/HISTORY.rst → desktop/core/ext-py/requests-2.6.0/HISTORY.rst

@@ -3,6 +3,91 @@
 Release History
 ---------------
 
+2.6.0 (2015-03-14)
+++++++++++++++++++
+
+**Bugfixes**
+
+- Fix handling of cookies on redirect. Previously a cookie without a host
+  value set would use the hostname for the redirected URL exposing requests
+  users to session fixation attacks and potentially cookie stealing. This was
+  disclosed privately by Matthew Daley of `BugFuzz <https://bugfuzz.com>`_.
+  An CVE identifier has not yet been assigned for this. This affects all
+  versions of requests from v2.1.0 to v2.5.3 (inclusive on both ends).
+
+- Fix error when requests is an ``install_requires`` dependency and ``python
+  setup.py test`` is run. (#2462)
+
+- Fix error when urllib3 is unbundled and requests continues to use the
+  vendored import location.
+
+- Include fixes to ``urllib3``'s header handling.
+
+- Requests' handling of unvendored dependencies is now more restrictive.
+
+**Features and Improvements**
+
+- Support bytearrays when passed as parameters in the ``files`` argument.
+  (#2468)
+
+- Avoid data duplication when creating a request with ``str``, ``bytes``, or
+  ``bytearray`` input to the ``files`` argument.
+
+2.5.3 (2015-02-24)
+++++++++++++++++++
+
+**Bugfixes**
+
+- Revert changes to our vendored certificate bundle. For more context see
+  (#2455, #2456, and http://bugs.python.org/issue23476)
+
+2.5.2 (2015-02-23)
+++++++++++++++++++
+
+**Features and Improvements**
+
+- Add sha256 fingerprint support. (`shazow/urllib3#540`_)
+
+- Improve the performance of headers. (`shazow/urllib3#544`_)
+
+**Bugfixes**
+
+- Copy pip's import machinery. When downstream redistributors remove
+  requests.packages.urllib3 the import machinery will continue to let those
+  same symbols work. Example usage in requests' documentation and 3rd-party
+  libraries relying on the vendored copies of urllib3 will work without having
+  to fallback to the system urllib3.
+
+- Attempt to quote parts of the URL on redirect if unquoting and then quoting
+  fails. (#2356)
+
+- Fix filename type check for multipart form-data uploads. (#2411)
+
+- Properly handle the case where a server issuing digest authentication
+  challenges provides both auth and auth-int qop-values. (#2408)
+
+- Fix a socket leak. (`shazow/urllib3#549`_)
+
+- Fix multiple ``Set-Cookie`` headers properly. (`shazow/urllib3#534`_)
+
+- Disable the built-in hostname verification. (`shazow/urllib3#526`_)
+
+- Fix the behaviour of decoding an exhausted stream. (`shazow/urllib3#535`_)
+
+**Security**
+
+- Pulled in an updated ``cacert.pem``.
+
+- Drop RC4 from the default cipher list. (`shazow/urllib3#551`_)
+
+.. _shazow/urllib3#551: https://github.com/shazow/urllib3/pull/551
+.. _shazow/urllib3#549: https://github.com/shazow/urllib3/pull/549
+.. _shazow/urllib3#544: https://github.com/shazow/urllib3/pull/544
+.. _shazow/urllib3#540: https://github.com/shazow/urllib3/pull/540
+.. _shazow/urllib3#535: https://github.com/shazow/urllib3/pull/535
+.. _shazow/urllib3#534: https://github.com/shazow/urllib3/pull/534
+.. _shazow/urllib3#526: https://github.com/shazow/urllib3/pull/526
+
 2.5.1 (2014-12-23)
 ++++++++++++++++++
 
@@ -103,7 +188,7 @@ Release History
 - Support for connect timeouts! Timeout now accepts a tuple (connect, read) which is used to set individual connect and read timeouts.
 - Allow copying of PreparedRequests without headers/cookies.
 - Updated bundled urllib3 version.
-- Refactored settings loading from environment  new `Session.merge_environment_settings`.
+- Refactored settings loading from environment -- new `Session.merge_environment_settings`.
 - Handle socket errors in iter_content.
 
 

+ 1 - 1
desktop/core/ext-py/requests-2.5.1/LICENSE → desktop/core/ext-py/requests-2.6.0/LICENSE

@@ -1,4 +1,4 @@
-Copyright 2014 Kenneth Reitz
+Copyright 2015 Kenneth Reitz
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/MANIFEST.in → desktop/core/ext-py/requests-2.6.0/MANIFEST.in


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/NOTICE → desktop/core/ext-py/requests-2.6.0/NOTICE


+ 91 - 6
desktop/core/ext-py/requests-2.5.1/PKG-INFO → desktop/core/ext-py/requests-2.6.0/PKG-INFO

@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: requests
-Version: 2.5.1
+Version: 2.6.0
 Summary: Python HTTP for Humans.
 Home-page: http://python-requests.org
 Author: Kenneth Reitz
@@ -9,11 +9,11 @@ License: Apache 2.0
 Description: Requests: HTTP for Humans
         =========================
         
-        .. image:: https://badge.fury.io/py/requests.png
-            :target: http://badge.fury.io/py/requests
+        .. image:: https://img.shields.io/pypi/v/requests.svg
+            :target: https://pypi.python.org/pypi/requests
         
-        .. image:: https://pypip.in/d/requests/badge.png
-                :target: https://crate.io/packages/requests/
+        .. image:: https://img.shields.io/pypi/dm/requests.svg
+                :target: https://pypi.python.org/pypi/requests
         
         
         Requests is an Apache2 Licensed HTTP library, written in Python, for human
@@ -98,6 +98,91 @@ Description: Requests: HTTP for Humans
         Release History
         ---------------
         
+        2.6.0 (2015-03-14)
+        ++++++++++++++++++
+        
+        **Bugfixes**
+        
+        - Fix handling of cookies on redirect. Previously a cookie without a host
+          value set would use the hostname for the redirected URL exposing requests
+          users to session fixation attacks and potentially cookie stealing. This was
+          disclosed privately by Matthew Daley of `BugFuzz <https://bugfuzz.com>`_.
+          An CVE identifier has not yet been assigned for this. This affects all
+          versions of requests from v2.1.0 to v2.5.3 (inclusive on both ends).
+        
+        - Fix error when requests is an ``install_requires`` dependency and ``python
+          setup.py test`` is run. (#2462)
+        
+        - Fix error when urllib3 is unbundled and requests continues to use the
+          vendored import location.
+        
+        - Include fixes to ``urllib3``'s header handling.
+        
+        - Requests' handling of unvendored dependencies is now more restrictive.
+        
+        **Features and Improvements**
+        
+        - Support bytearrays when passed as parameters in the ``files`` argument.
+          (#2468)
+        
+        - Avoid data duplication when creating a request with ``str``, ``bytes``, or
+          ``bytearray`` input to the ``files`` argument.
+        
+        2.5.3 (2015-02-24)
+        ++++++++++++++++++
+        
+        **Bugfixes**
+        
+        - Revert changes to our vendored certificate bundle. For more context see
+          (#2455, #2456, and http://bugs.python.org/issue23476)
+        
+        2.5.2 (2015-02-23)
+        ++++++++++++++++++
+        
+        **Features and Improvements**
+        
+        - Add sha256 fingerprint support. (`shazow/urllib3#540`_)
+        
+        - Improve the performance of headers. (`shazow/urllib3#544`_)
+        
+        **Bugfixes**
+        
+        - Copy pip's import machinery. When downstream redistributors remove
+          requests.packages.urllib3 the import machinery will continue to let those
+          same symbols work. Example usage in requests' documentation and 3rd-party
+          libraries relying on the vendored copies of urllib3 will work without having
+          to fallback to the system urllib3.
+        
+        - Attempt to quote parts of the URL on redirect if unquoting and then quoting
+          fails. (#2356)
+        
+        - Fix filename type check for multipart form-data uploads. (#2411)
+        
+        - Properly handle the case where a server issuing digest authentication
+          challenges provides both auth and auth-int qop-values. (#2408)
+        
+        - Fix a socket leak. (`shazow/urllib3#549`_)
+        
+        - Fix multiple ``Set-Cookie`` headers properly. (`shazow/urllib3#534`_)
+        
+        - Disable the built-in hostname verification. (`shazow/urllib3#526`_)
+        
+        - Fix the behaviour of decoding an exhausted stream. (`shazow/urllib3#535`_)
+        
+        **Security**
+        
+        - Pulled in an updated ``cacert.pem``.
+        
+        - Drop RC4 from the default cipher list. (`shazow/urllib3#551`_)
+        
+        .. _shazow/urllib3#551: https://github.com/shazow/urllib3/pull/551
+        .. _shazow/urllib3#549: https://github.com/shazow/urllib3/pull/549
+        .. _shazow/urllib3#544: https://github.com/shazow/urllib3/pull/544
+        .. _shazow/urllib3#540: https://github.com/shazow/urllib3/pull/540
+        .. _shazow/urllib3#535: https://github.com/shazow/urllib3/pull/535
+        .. _shazow/urllib3#534: https://github.com/shazow/urllib3/pull/534
+        .. _shazow/urllib3#526: https://github.com/shazow/urllib3/pull/526
+        
         2.5.1 (2014-12-23)
         ++++++++++++++++++
         
@@ -198,7 +283,7 @@ Description: Requests: HTTP for Humans
         - Support for connect timeouts! Timeout now accepts a tuple (connect, read) which is used to set individual connect and read timeouts.
         - Allow copying of PreparedRequests without headers/cookies.
         - Updated bundled urllib3 version.
-        - Refactored settings loading from environment  new `Session.merge_environment_settings`.
+        - Refactored settings loading from environment -- new `Session.merge_environment_settings`.
         - Handle socket errors in iter_content.
         
         

+ 4 - 4
desktop/core/ext-py/requests-2.5.1/README.rst → desktop/core/ext-py/requests-2.6.0/README.rst

@@ -1,11 +1,11 @@
 Requests: HTTP for Humans
 =========================
 
-.. image:: https://badge.fury.io/py/requests.png
-    :target: http://badge.fury.io/py/requests
+.. image:: https://img.shields.io/pypi/v/requests.svg
+    :target: https://pypi.python.org/pypi/requests
 
-.. image:: https://pypip.in/d/requests/badge.png
-        :target: https://crate.io/packages/requests/
+.. image:: https://img.shields.io/pypi/dm/requests.svg
+        :target: https://pypi.python.org/pypi/requests
 
 
 Requests is an Apache2 Licensed HTTP library, written in Python, for human

+ 4 - 4
desktop/core/ext-py/requests-2.5.1/requests/__init__.py → desktop/core/ext-py/requests-2.6.0/requests/__init__.py

@@ -36,17 +36,17 @@ usage:
 The other HTTP methods are supported - see `requests.api`. Full documentation
 is at <http://python-requests.org>.
 
-:copyright: (c) 2014 by Kenneth Reitz.
+:copyright: (c) 2015 by Kenneth Reitz.
 :license: Apache 2.0, see LICENSE for more details.
 
 """
 
 __title__ = 'requests'
-__version__ = '2.5.1'
-__build__ = 0x020501
+__version__ = '2.6.0'
+__build__ = 0x020503
 __author__ = 'Kenneth Reitz'
 __license__ = 'Apache 2.0'
-__copyright__ = 'Copyright 2014 Kenneth Reitz'
+__copyright__ = 'Copyright 2015 Kenneth Reitz'
 
 # Attempt to enable urllib3's SNI support, if possible
 try:

+ 1 - 1
desktop/core/ext-py/requests-2.5.1/requests/adapters.py → desktop/core/ext-py/requests-2.6.0/requests/adapters.py

@@ -11,10 +11,10 @@ and maintain connections.
 import socket
 
 from .models import Response
-from .packages.urllib3 import Retry
 from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
 from .packages.urllib3.response import HTTPResponse
 from .packages.urllib3.util import Timeout as TimeoutSauce
+from .packages.urllib3.util.retry import Retry
 from .compat import urlparse, basestring
 from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers,
                     prepend_scheme_if_needed, get_auth_from_url, urldefragauth)

+ 23 - 8
desktop/core/ext-py/requests-2.5.1/requests/api.py → desktop/core/ext-py/requests-2.6.0/requests/api.py

@@ -16,7 +16,6 @@ from . import sessions
 
 def request(method, url, **kwargs):
     """Constructs and sends a :class:`Request <Request>`.
-    Returns :class:`Response <Response>` object.
 
     :param method: method for the new :class:`Request` object.
     :param url: URL for the new :class:`Request` object.
@@ -37,6 +36,8 @@ def request(method, url, **kwargs):
     :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.
     :param stream: (optional) if ``False``, the response content will be immediately downloaded.
     :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
 
     Usage::
 
@@ -55,10 +56,12 @@ def request(method, url, **kwargs):
 
 
 def get(url, **kwargs):
-    """Sends a GET request. Returns :class:`Response` object.
+    """Sends a GET request.
 
     :param url: URL for the new :class:`Request` object.
     :param \*\*kwargs: Optional arguments that ``request`` takes.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
     """
 
     kwargs.setdefault('allow_redirects', True)
@@ -66,10 +69,12 @@ def get(url, **kwargs):
 
 
 def options(url, **kwargs):
-    """Sends a OPTIONS request. Returns :class:`Response` object.
+    """Sends a OPTIONS request.
 
     :param url: URL for the new :class:`Request` object.
     :param \*\*kwargs: Optional arguments that ``request`` takes.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
     """
 
     kwargs.setdefault('allow_redirects', True)
@@ -77,10 +82,12 @@ def options(url, **kwargs):
 
 
 def head(url, **kwargs):
-    """Sends a HEAD request. Returns :class:`Response` object.
+    """Sends a HEAD request.
 
     :param url: URL for the new :class:`Request` object.
     :param \*\*kwargs: Optional arguments that ``request`` takes.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
     """
 
     kwargs.setdefault('allow_redirects', False)
@@ -88,44 +95,52 @@ def head(url, **kwargs):
 
 
 def post(url, data=None, json=None, **kwargs):
-    """Sends a POST request. Returns :class:`Response` object.
+    """Sends a POST request.
 
     :param url: URL for the new :class:`Request` object.
     :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
     :param json: (optional) json data to send in the body of the :class:`Request`.
     :param \*\*kwargs: Optional arguments that ``request`` takes.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
     """
 
     return request('post', url, data=data, json=json, **kwargs)
 
 
 def put(url, data=None, **kwargs):
-    """Sends a PUT request. Returns :class:`Response` object.
+    """Sends a PUT request.
 
     :param url: URL for the new :class:`Request` object.
     :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
     :param \*\*kwargs: Optional arguments that ``request`` takes.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
     """
 
     return request('put', url, data=data, **kwargs)
 
 
 def patch(url, data=None, **kwargs):
-    """Sends a PATCH request. Returns :class:`Response` object.
+    """Sends a PATCH request.
 
     :param url: URL for the new :class:`Request` object.
     :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
     :param \*\*kwargs: Optional arguments that ``request`` takes.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
     """
 
     return request('patch', url,  data=data, **kwargs)
 
 
 def delete(url, **kwargs):
-    """Sends a DELETE request. Returns :class:`Response` object.
+    """Sends a DELETE request.
 
     :param url: URL for the new :class:`Request` object.
     :param \*\*kwargs: Optional arguments that ``request`` takes.
+    :return: :class:`Response <Response>` object
+    :rtype: requests.Response
     """
 
     return request('delete', url, **kwargs)

+ 3 - 1
desktop/core/ext-py/requests-2.5.1/requests/auth.py → desktop/core/ext-py/requests-2.6.0/requests/auth.py

@@ -124,13 +124,15 @@ class HTTPDigestAuth(AuthBase):
         s += os.urandom(8)
 
         cnonce = (hashlib.sha1(s).hexdigest()[:16])
-        noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, HA2)
         if _algorithm == 'MD5-SESS':
             HA1 = hash_utf8('%s:%s:%s' % (HA1, nonce, cnonce))
 
         if qop is None:
             respdig = KD(HA1, "%s:%s" % (nonce, HA2))
         elif qop == 'auth' or 'auth' in qop.split(','):
+            noncebit = "%s:%s:%s:%s:%s" % (
+                nonce, ncvalue, cnonce, 'auth', HA2
+                )
             respdig = KD(HA1, noncebit)
         else:
             # XXX handle auth-int.

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/cacert.pem → desktop/core/ext-py/requests-2.6.0/requests/cacert.pem


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/certs.py → desktop/core/ext-py/requests-2.6.0/requests/certs.py


+ 0 - 53
desktop/core/ext-py/requests-2.5.1/requests/compat.py → desktop/core/ext-py/requests-2.6.0/requests/compat.py

@@ -21,58 +21,6 @@ is_py2 = (_ver[0] == 2)
 #: Python 3.x?
 is_py3 = (_ver[0] == 3)
 
-#: Python 3.0.x
-is_py30 = (is_py3 and _ver[1] == 0)
-
-#: Python 3.1.x
-is_py31 = (is_py3 and _ver[1] == 1)
-
-#: Python 3.2.x
-is_py32 = (is_py3 and _ver[1] == 2)
-
-#: Python 3.3.x
-is_py33 = (is_py3 and _ver[1] == 3)
-
-#: Python 3.4.x
-is_py34 = (is_py3 and _ver[1] == 4)
-
-#: Python 2.7.x
-is_py27 = (is_py2 and _ver[1] == 7)
-
-#: Python 2.6.x
-is_py26 = (is_py2 and _ver[1] == 6)
-
-#: Python 2.5.x
-is_py25 = (is_py2 and _ver[1] == 5)
-
-#: Python 2.4.x
-is_py24 = (is_py2 and _ver[1] == 4)   # I'm assuming this is not by choice.
-
-
-# ---------
-# Platforms
-# ---------
-
-
-# Syntax sugar.
-_ver = sys.version.lower()
-
-is_pypy = ('pypy' in _ver)
-is_jython = ('jython' in _ver)
-is_ironpython = ('iron' in _ver)
-
-# Assume CPython, if nothing else.
-is_cpython = not any((is_pypy, is_jython, is_ironpython))
-
-# Windows-based system.
-is_windows = 'win32' in str(sys.platform).lower()
-
-# Standard Linux 2+ system.
-is_linux = ('linux' in str(sys.platform).lower())
-is_osx = ('darwin' in str(sys.platform).lower())
-is_hpux = ('hpux' in str(sys.platform).lower())   # Complete guess.
-is_solaris = ('solar==' in str(sys.platform).lower())   # Complete guess.
-
 try:
     import simplejson as json
 except (ImportError, SyntaxError):
@@ -99,7 +47,6 @@ if is_py2:
     basestring = basestring
     numeric_types = (int, long, float)
 
-
 elif is_py3:
     from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag
     from urllib.request import parse_http_list, getproxies, proxy_bypass

+ 49 - 40
desktop/core/ext-py/requests-2.5.1/requests/cookies.py → desktop/core/ext-py/requests-2.6.0/requests/cookies.py

@@ -157,26 +157,28 @@ class CookieConflictError(RuntimeError):
 
 
 class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
-    """Compatibility class; is a cookielib.CookieJar, but exposes a dict interface.
+    """Compatibility class; is a cookielib.CookieJar, but exposes a dict
+    interface.
 
     This is the CookieJar we create by default for requests and sessions that
     don't specify one, since some clients may expect response.cookies and
     session.cookies to support dict operations.
 
-    Don't use the dict interface internally; it's just for compatibility with
-    with external client code. All `requests` code should work out of the box
-    with externally provided instances of CookieJar, e.g., LWPCookieJar and
-    FileCookieJar.
-
-    Caution: dictionary operations that are normally O(1) may be O(n).
+    Requests does not use the dict interface internally; it's just for
+    compatibility with external client code. All requests code should work
+    out of the box with externally provided instances of ``CookieJar``, e.g.
+    ``LWPCookieJar`` and ``FileCookieJar``.
 
     Unlike a regular CookieJar, this class is pickleable.
-    """
 
+    .. warning:: dictionary operations that are normally O(1) may be O(n).
+    """
     def get(self, name, default=None, domain=None, path=None):
         """Dict-like get() that also supports optional domain and path args in
         order to resolve naming collisions from using one cookie jar over
-        multiple domains. Caution: operation is O(n), not O(1)."""
+        multiple domains.
+
+        .. warning:: operation is O(n), not O(1)."""
         try:
             return self._find_no_duplicates(name, domain, path)
         except KeyError:
@@ -199,37 +201,38 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
         return c
 
     def iterkeys(self):
-        """Dict-like iterkeys() that returns an iterator of names of cookies from the jar.
-        See itervalues() and iteritems()."""
+        """Dict-like iterkeys() that returns an iterator of names of cookies
+        from the jar. See itervalues() and iteritems()."""
         for cookie in iter(self):
             yield cookie.name
 
     def keys(self):
-        """Dict-like keys() that returns a list of names of cookies from the jar.
-        See values() and items()."""
+        """Dict-like keys() that returns a list of names of cookies from the
+        jar. See values() and items()."""
         return list(self.iterkeys())
 
     def itervalues(self):
-        """Dict-like itervalues() that returns an iterator of values of cookies from the jar.
-        See iterkeys() and iteritems()."""
+        """Dict-like itervalues() that returns an iterator of values of cookies
+        from the jar. See iterkeys() and iteritems()."""
         for cookie in iter(self):
             yield cookie.value
 
     def values(self):
-        """Dict-like values() that returns a list of values of cookies from the jar.
-        See keys() and items()."""
+        """Dict-like values() that returns a list of values of cookies from the
+        jar. See keys() and items()."""
         return list(self.itervalues())
 
     def iteritems(self):
-        """Dict-like iteritems() that returns an iterator of name-value tuples from the jar.
-        See iterkeys() and itervalues()."""
+        """Dict-like iteritems() that returns an iterator of name-value tuples
+        from the jar. See iterkeys() and itervalues()."""
         for cookie in iter(self):
             yield cookie.name, cookie.value
 
     def items(self):
-        """Dict-like items() that returns a list of name-value tuples from the jar.
-        See keys() and values(). Allows client-code to call "dict(RequestsCookieJar)
-        and get a vanilla python dict of key value pairs."""
+        """Dict-like items() that returns a list of name-value tuples from the
+        jar. See keys() and values(). Allows client-code to call
+        ``dict(RequestsCookieJar)`` and get a vanilla python dict of key value
+        pairs."""
         return list(self.iteritems())
 
     def list_domains(self):
@@ -259,8 +262,9 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
         return False  # there is only one domain in jar
 
     def get_dict(self, domain=None, path=None):
-        """Takes as an argument an optional domain and path and returns a plain old
-        Python dict of name-value pairs of cookies that meet the requirements."""
+        """Takes as an argument an optional domain and path and returns a plain
+        old Python dict of name-value pairs of cookies that meet the
+        requirements."""
         dictionary = {}
         for cookie in iter(self):
             if (domain is None or cookie.domain == domain) and (path is None
@@ -269,21 +273,24 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
         return dictionary
 
     def __getitem__(self, name):
-        """Dict-like __getitem__() for compatibility with client code. Throws exception
-        if there are more than one cookie with name. In that case, use the more
-        explicit get() method instead. Caution: operation is O(n), not O(1)."""
+        """Dict-like __getitem__() for compatibility with client code. Throws
+        exception if there are more than one cookie with name. In that case,
+        use the more explicit get() method instead.
+
+        .. warning:: operation is O(n), not O(1)."""
 
         return self._find_no_duplicates(name)
 
     def __setitem__(self, name, value):
-        """Dict-like __setitem__ for compatibility with client code. Throws exception
-        if there is already a cookie of that name in the jar. In that case, use the more
-        explicit set() method instead."""
+        """Dict-like __setitem__ for compatibility with client code. Throws
+        exception if there is already a cookie of that name in the jar. In that
+        case, use the more explicit set() method instead."""
 
         self.set(name, value)
 
     def __delitem__(self, name):
-        """Deletes a cookie given a name. Wraps cookielib.CookieJar's remove_cookie_by_name()."""
+        """Deletes a cookie given a name. Wraps ``cookielib.CookieJar``'s
+        ``remove_cookie_by_name()``."""
         remove_cookie_by_name(self, name)
 
     def set_cookie(self, cookie, *args, **kwargs):
@@ -300,10 +307,11 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
             super(RequestsCookieJar, self).update(other)
 
     def _find(self, name, domain=None, path=None):
-        """Requests uses this method internally to get cookie values. Takes as args name
-        and optional domain and path. Returns a cookie.value. If there are conflicting cookies,
-        _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown
-        if there are conflicting cookies."""
+        """Requests uses this method internally to get cookie values. Takes as
+        args name and optional domain and path. Returns a cookie.value. If
+        there are conflicting cookies, _find arbitrarily chooses one. See
+        _find_no_duplicates if you want an exception thrown if there are
+        conflicting cookies."""
         for cookie in iter(self):
             if cookie.name == name:
                 if domain is None or cookie.domain == domain:
@@ -313,10 +321,11 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
         raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
 
     def _find_no_duplicates(self, name, domain=None, path=None):
-        """__get_item__ and get call _find_no_duplicates -- never used in Requests internally.
-        Takes as args name and optional domain and path. Returns a cookie.value.
-        Throws KeyError if cookie is not found and CookieConflictError if there are
-        multiple cookies that match name and optionally domain and path."""
+        """Both ``__get_item__`` and ``get`` call this function: it's never
+        used elsewhere in Requests. Takes as args name and optional domain and
+        path. Returns a cookie.value. Throws KeyError if cookie is not found
+        and CookieConflictError if there are multiple cookies that match name
+        and optionally domain and path."""
         toReturn = None
         for cookie in iter(self):
             if cookie.name == name:
@@ -440,7 +449,7 @@ def merge_cookies(cookiejar, cookies):
     """
     if not isinstance(cookiejar, cookielib.CookieJar):
         raise ValueError('You can only merge into CookieJar')
-    
+
     if isinstance(cookies, dict):
         cookiejar = cookiejar_from_dict(
             cookies, cookiejar=cookiejar, overwrite=False)

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/exceptions.py → desktop/core/ext-py/requests-2.6.0/requests/exceptions.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/hooks.py → desktop/core/ext-py/requests-2.6.0/requests/hooks.py


+ 8 - 5
desktop/core/ext-py/requests-2.5.1/requests/models.py → desktop/core/ext-py/requests-2.6.0/requests/models.py

@@ -143,12 +143,13 @@ class RequestEncodingMixin(object):
             else:
                 fn = guess_filename(v) or k
                 fp = v
-            if isinstance(fp, str):
-                fp = StringIO(fp)
-            if isinstance(fp, bytes):
-                fp = BytesIO(fp)
 
-            rf = RequestField(name=k, data=fp.read(),
+            if isinstance(fp, (str, bytes, bytearray)):
+                fdata = fp
+            else:
+                fdata = fp.read()
+
+            rf = RequestField(name=k, data=fdata,
                               filename=fn, headers=fh)
             rf.make_multipart(content_type=ft)
             new_fields.append(rf)
@@ -688,6 +689,8 @@ class Response(object):
         """Iterates over the response data, one line at a time.  When
         stream=True is set on the request, this avoids reading the
         content at once into memory for large responses.
+
+        .. note:: This method is not reentrant safe.
         """
 
         pending = None

+ 107 - 0
desktop/core/ext-py/requests-2.6.0/requests/packages/__init__.py

@@ -0,0 +1,107 @@
+"""
+Copyright (c) Donald Stufft, pip, and individual contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+"""
+from __future__ import absolute_import
+
+import sys
+
+
+class VendorAlias(object):
+
+    def __init__(self, package_names):
+        self._package_names = package_names
+        self._vendor_name = __name__
+        self._vendor_pkg = self._vendor_name + "."
+        self._vendor_pkgs = [
+            self._vendor_pkg + name for name in self._package_names
+        ]
+
+    def find_module(self, fullname, path=None):
+        if fullname.startswith(self._vendor_pkg):
+            return self
+
+    def load_module(self, name):
+        # Ensure that this only works for the vendored name
+        if not name.startswith(self._vendor_pkg):
+            raise ImportError(
+                "Cannot import %s, must be a subpackage of '%s'." % (
+                    name, self._vendor_name,
+                )
+            )
+
+        if not (name == self._vendor_name or
+                any(name.startswith(pkg) for pkg in self._vendor_pkgs)):
+            raise ImportError(
+                "Cannot import %s, must be one of %s." % (
+                    name, self._vendor_pkgs
+                )
+            )
+
+        # Check to see if we already have this item in sys.modules, if we do
+        # then simply return that.
+        if name in sys.modules:
+            return sys.modules[name]
+
+        # Check to see if we can import the vendor name
+        try:
+            # We do this dance here because we want to try and import this
+            # module without hitting a recursion error because of a bunch of
+            # VendorAlias instances on sys.meta_path
+            real_meta_path = sys.meta_path[:]
+            try:
+                sys.meta_path = [
+                    m for m in sys.meta_path
+                    if not isinstance(m, VendorAlias)
+                ]
+                __import__(name)
+                module = sys.modules[name]
+            finally:
+                # Re-add any additions to sys.meta_path that were made while
+                # during the import we just did, otherwise things like
+                # requests.packages.urllib3.poolmanager will fail.
+                for m in sys.meta_path:
+                    if m not in real_meta_path:
+                        real_meta_path.append(m)
+
+                # Restore sys.meta_path with any new items.
+                sys.meta_path = real_meta_path
+        except ImportError:
+            # We can't import the vendor name, so we'll try to import the
+            # "real" name.
+            real_name = name[len(self._vendor_pkg):]
+            try:
+                __import__(real_name)
+                module = sys.modules[real_name]
+            except ImportError:
+                raise ImportError("No module named '%s'" % (name,))
+
+        # If we've gotten here we've found the module we're looking for, either
+        # as part of our vendored package, or as the real name, so we'll add
+        # it to sys.modules as the vendored name so that we don't have to do
+        # the lookup again.
+        sys.modules[name] = module
+
+        # Finally, return the loaded module
+        return module
+
+
+sys.meta_path.append(VendorAlias(["urllib3", "chardet"]))

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/__init__.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/__init__.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/big5freq.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/big5freq.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/big5prober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/big5prober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/chardetect.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/chardetect.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/chardistribution.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/chardistribution.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/charsetgroupprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/charsetgroupprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/charsetprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/charsetprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/codingstatemachine.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/codingstatemachine.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/compat.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/compat.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/constants.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/constants.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/cp949prober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/cp949prober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/escprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/escprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/escsm.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/escsm.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/eucjpprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/eucjpprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/euckrfreq.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euckrfreq.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/euckrprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euckrprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/euctwfreq.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euctwfreq.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/euctwprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/euctwprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/gb2312freq.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/gb2312freq.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/gb2312prober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/gb2312prober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/hebrewprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/hebrewprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/jisfreq.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/jisfreq.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/jpcntx.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/jpcntx.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/langbulgarianmodel.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langbulgarianmodel.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/langcyrillicmodel.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langcyrillicmodel.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/langgreekmodel.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langgreekmodel.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/langhebrewmodel.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langhebrewmodel.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/langhungarianmodel.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langhungarianmodel.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/langthaimodel.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/langthaimodel.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/latin1prober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/latin1prober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/mbcharsetprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/mbcharsetprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/mbcsgroupprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/mbcsgroupprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/mbcssm.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/mbcssm.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/sbcharsetprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/sbcharsetprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/sbcsgroupprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/sbcsgroupprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/sjisprober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/sjisprober.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/universaldetector.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/universaldetector.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/chardet/utf8prober.py → desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/utf8prober.py


+ 2 - 2
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/__init__.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/__init__.py

@@ -4,7 +4,7 @@ urllib3 - Thread-safe connection pooling and re-using.
 
 __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'
 __license__ = 'MIT'
-__version__ = 'dev'
+__version__ = '1.10.2'
 
 
 from .connectionpool import (
@@ -55,7 +55,7 @@ def add_stderr_logger(level=logging.DEBUG):
 del NullHandler
 
 
-# Set security warning to only go off once by default.
+# Set security warning to always go off by default.
 import warnings
 warnings.simplefilter('always', exceptions.SecurityWarning)
 

+ 320 - 0
desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/_collections.py

@@ -0,0 +1,320 @@
+from collections import Mapping, MutableMapping
+try:
+    from threading import RLock
+except ImportError:  # Platform-specific: No threads available
+    class RLock:
+        def __enter__(self):
+            pass
+
+        def __exit__(self, exc_type, exc_value, traceback):
+            pass
+
+
+try:  # Python 2.7+
+    from collections import OrderedDict
+except ImportError:
+    from .packages.ordered_dict import OrderedDict
+from .packages.six import iterkeys, itervalues, PY3
+
+
+__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']
+
+
+_Null = object()
+
+
+class RecentlyUsedContainer(MutableMapping):
+    """
+    Provides a thread-safe dict-like container which maintains up to
+    ``maxsize`` keys while throwing away the least-recently-used keys beyond
+    ``maxsize``.
+
+    :param maxsize:
+        Maximum number of recent elements to retain.
+
+    :param dispose_func:
+        Every time an item is evicted from the container,
+        ``dispose_func(value)`` is called.  Callback which will get called
+    """
+
+    ContainerCls = OrderedDict
+
+    def __init__(self, maxsize=10, dispose_func=None):
+        self._maxsize = maxsize
+        self.dispose_func = dispose_func
+
+        self._container = self.ContainerCls()
+        self.lock = RLock()
+
+    def __getitem__(self, key):
+        # Re-insert the item, moving it to the end of the eviction line.
+        with self.lock:
+            item = self._container.pop(key)
+            self._container[key] = item
+            return item
+
+    def __setitem__(self, key, value):
+        evicted_value = _Null
+        with self.lock:
+            # Possibly evict the existing value of 'key'
+            evicted_value = self._container.get(key, _Null)
+            self._container[key] = value
+
+            # If we didn't evict an existing value, we might have to evict the
+            # least recently used item from the beginning of the container.
+            if len(self._container) > self._maxsize:
+                _key, evicted_value = self._container.popitem(last=False)
+
+        if self.dispose_func and evicted_value is not _Null:
+            self.dispose_func(evicted_value)
+
+    def __delitem__(self, key):
+        with self.lock:
+            value = self._container.pop(key)
+
+        if self.dispose_func:
+            self.dispose_func(value)
+
+    def __len__(self):
+        with self.lock:
+            return len(self._container)
+
+    def __iter__(self):
+        raise NotImplementedError('Iteration over this class is unlikely to be threadsafe.')
+
+    def clear(self):
+        with self.lock:
+            # Copy pointers to all values, then wipe the mapping
+            values = list(itervalues(self._container))
+            self._container.clear()
+
+        if self.dispose_func:
+            for value in values:
+                self.dispose_func(value)
+
+    def keys(self):
+        with self.lock:
+            return list(iterkeys(self._container))
+
+
+_dict_setitem = dict.__setitem__
+_dict_getitem = dict.__getitem__
+_dict_delitem = dict.__delitem__
+_dict_contains = dict.__contains__
+_dict_setdefault = dict.setdefault
+
+
+class HTTPHeaderDict(dict):
+    """
+    :param headers:
+        An iterable of field-value pairs. Must not contain multiple field names
+        when compared case-insensitively.
+
+    :param kwargs:
+        Additional field-value pairs to pass in to ``dict.update``.
+
+    A ``dict`` like container for storing HTTP Headers.
+
+    Field names are stored and compared case-insensitively in compliance with
+    RFC 7230. Iteration provides the first case-sensitive key seen for each
+    case-insensitive pair.
+
+    Using ``__setitem__`` syntax overwrites fields that compare equal
+    case-insensitively in order to maintain ``dict``'s api. For fields that
+    compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``
+    in a loop.
+
+    If multiple fields that are equal case-insensitively are passed to the
+    constructor or ``.update``, the behavior is undefined and some will be
+    lost.
+
+    >>> headers = HTTPHeaderDict()
+    >>> headers.add('Set-Cookie', 'foo=bar')
+    >>> headers.add('set-cookie', 'baz=quxx')
+    >>> headers['content-length'] = '7'
+    >>> headers['SET-cookie']
+    'foo=bar, baz=quxx'
+    >>> headers['Content-Length']
+    '7'
+    """
+
+    def __init__(self, headers=None, **kwargs):
+        dict.__init__(self)
+        if headers is not None:
+            if isinstance(headers, HTTPHeaderDict):
+                self._copy_from(headers)
+            else:
+                self.extend(headers)
+        if kwargs:
+            self.extend(kwargs)
+
+    def __setitem__(self, key, val):
+        return _dict_setitem(self, key.lower(), (key, val))
+
+    def __getitem__(self, key):
+        val = _dict_getitem(self, key.lower())
+        return ', '.join(val[1:])
+
+    def __delitem__(self, key):
+        return _dict_delitem(self, key.lower())
+
+    def __contains__(self, key):
+        return _dict_contains(self, key.lower())
+
+    def __eq__(self, other):
+        if not isinstance(other, Mapping) and not hasattr(other, 'keys'):
+            return False
+        if not isinstance(other, type(self)):
+            other = type(self)(other)
+        return dict((k1, self[k1]) for k1 in self) == dict((k2, other[k2]) for k2 in other)
+
+    def __ne__(self, other):
+        return not self.__eq__(other)
+
+    values = MutableMapping.values
+    get = MutableMapping.get
+    update = MutableMapping.update
+    
+    if not PY3: # Python 2
+        iterkeys = MutableMapping.iterkeys
+        itervalues = MutableMapping.itervalues
+
+    __marker = object()
+
+    def pop(self, key, default=__marker):
+        '''D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
+          If key is not found, d is returned if given, otherwise KeyError is raised.
+        '''
+        # Using the MutableMapping function directly fails due to the private marker.
+        # Using ordinary dict.pop would expose the internal structures.
+        # So let's reinvent the wheel.
+        try:
+            value = self[key]
+        except KeyError:
+            if default is self.__marker:
+                raise
+            return default
+        else:
+            del self[key]
+            return value
+
+    def discard(self, key):
+        try:
+            del self[key]
+        except KeyError:
+            pass
+
+    def add(self, key, val):
+        """Adds a (name, value) pair, doesn't overwrite the value if it already
+        exists.
+
+        >>> headers = HTTPHeaderDict(foo='bar')
+        >>> headers.add('Foo', 'baz')
+        >>> headers['foo']
+        'bar, baz'
+        """
+        key_lower = key.lower()
+        new_vals = key, val
+        # Keep the common case aka no item present as fast as possible
+        vals = _dict_setdefault(self, key_lower, new_vals)
+        if new_vals is not vals:
+            # new_vals was not inserted, as there was a previous one
+            if isinstance(vals, list):
+                # If already several items got inserted, we have a list
+                vals.append(val)
+            else:
+                # vals should be a tuple then, i.e. only one item so far
+                # Need to convert the tuple to list for further extension
+                _dict_setitem(self, key_lower, [vals[0], vals[1], val])
+
+    def extend(*args, **kwargs):
+        """Generic import function for any type of header-like object.
+        Adapted version of MutableMapping.update in order to insert items
+        with self.add instead of self.__setitem__
+        """
+        if len(args) > 2:
+            raise TypeError("update() takes at most 2 positional "
+                            "arguments ({} given)".format(len(args)))
+        elif not args:
+            raise TypeError("update() takes at least 1 argument (0 given)")
+        self = args[0]
+        other = args[1] if len(args) >= 2 else ()
+        
+        if isinstance(other, Mapping):
+            for key in other:
+                self.add(key, other[key])
+        elif hasattr(other, "keys"):
+            for key in other.keys():
+                self.add(key, other[key])
+        else:
+            for key, value in other:
+                self.add(key, value)
+
+        for key, value in kwargs.items():
+            self.add(key, value)
+
+    def getlist(self, key):
+        """Returns a list of all the values for the named field. Returns an
+        empty list if the key doesn't exist."""
+        try:
+            vals = _dict_getitem(self, key.lower())
+        except KeyError:
+            return []
+        else:
+            if isinstance(vals, tuple):
+                return [vals[1]]
+            else:
+                return vals[1:]
+
+    # Backwards compatibility for httplib
+    getheaders = getlist
+    getallmatchingheaders = getlist
+    iget = getlist
+
+    def __repr__(self):
+        return "%s(%s)" % (type(self).__name__, dict(self.itermerged()))
+
+    def _copy_from(self, other):
+        for key in other:
+            val = _dict_getitem(other, key)
+            if isinstance(val, list):
+                # Don't need to convert tuples
+                val = list(val)
+            _dict_setitem(self, key, val)
+
+    def copy(self):
+        clone = type(self)()
+        clone._copy_from(self)
+        return clone
+
+    def iteritems(self):
+        """Iterate over all header lines, including duplicate ones."""
+        for key in self:
+            vals = _dict_getitem(self, key)
+            for val in vals[1:]:
+                yield vals[0], val
+
+    def itermerged(self):
+        """Iterate over all headers, merging duplicate ones together."""
+        for key in self:
+            val = _dict_getitem(self, key)
+            yield val[0], ', '.join(val[1:])
+
+    def items(self):
+        return list(self.iteritems())
+
+    @classmethod
+    def from_httplib(cls, message, duplicates=('set-cookie',)): # Python 2
+        """Read headers from a Python 2 httplib message object."""
+        ret = cls(message.items())
+        # ret now contains only the last header line for each duplicate.
+        # Importing with all duplicates would be nice, but this would
+        # mean to repeat most of the raw parsing already done, when the
+        # message object was created. Extracting only the headers of interest 
+        # separately, the cookies, should be faster and requires less
+        # extra code.
+        for key in duplicates:
+            ret.discard(key)
+            for val in message.getheaders(key):
+                ret.add(key, val)
+            return ret

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/connection.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/connection.py


+ 54 - 19
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/connectionpool.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/connectionpool.py

@@ -72,6 +72,21 @@ class ConnectionPool(object):
         return '%s(host=%r, port=%r)' % (type(self).__name__,
                                          self.host, self.port)
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        self.close()
+        # Return False to re-raise any potential exceptions
+        return False
+
+    def close():
+        """
+        Close all pooled connections and disable the pool.
+        """
+        pass
+
+
 # This is taken from http://hg.python.org/cpython/file/7aaba721ebc0/Lib/socket.py#l252
 _blocking_errnos = set([errno.EAGAIN, errno.EWOULDBLOCK])
 
@@ -266,6 +281,10 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
         """
         pass
 
+    def _prepare_proxy(self, conn):
+        # Nothing to do for HTTP connections.
+        pass
+
     def _get_timeout(self, timeout):
         """ Helper that always returns a :class:`urllib3.util.Timeout` """
         if timeout is _Default:
@@ -349,7 +368,7 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
 
         # Receive the response from the server
         try:
-            try:  # Python 2.7+, use buffering of HTTP responses
+            try:  # Python 2.7, use buffering of HTTP responses
                 httplib_response = conn.getresponse(buffering=True)
             except TypeError:  # Python 2.6 and older
                 httplib_response = conn.getresponse()
@@ -510,11 +529,18 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
 
         try:
             # Request a connection from the queue.
+            timeout_obj = self._get_timeout(timeout)
             conn = self._get_conn(timeout=pool_timeout)
 
+            conn.timeout = timeout_obj.connect_timeout
+
+            is_new_proxy_conn = self.proxy is not None and not getattr(conn, 'sock', None)
+            if is_new_proxy_conn:
+                self._prepare_proxy(conn)
+
             # Make the request on the httplib connection object.
             httplib_response = self._make_request(conn, method, url,
-                                                  timeout=timeout,
+                                                  timeout=timeout_obj,
                                                   body=body, headers=headers)
 
             # If we're going to release the connection in ``finally:``, then
@@ -547,6 +573,14 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
                 conn = None
             raise SSLError(e)
 
+        except SSLError:
+            # Treat SSLError separately from BaseSSLError to preserve
+            # traceback.
+            if conn:
+                conn.close()
+                conn = None
+            raise
+
         except (TimeoutError, HTTPException, SocketError, ConnectionError) as e:
             if conn:
                 # Discard the connection for these exceptions. It will be
@@ -554,14 +588,13 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods):
                 conn.close()
                 conn = None
 
-            stacktrace = sys.exc_info()[2]
             if isinstance(e, SocketError) and self.proxy:
                 e = ProxyError('Cannot connect to proxy.', e)
             elif isinstance(e, (SocketError, HTTPException)):
                 e = ProtocolError('Connection aborted.', e)
 
-            retries = retries.increment(method, url, error=e,
-                                        _pool=self, _stacktrace=stacktrace)
+            retries = retries.increment(method, url, error=e, _pool=self,
+                                        _stacktrace=sys.exc_info()[2])
             retries.sleep()
 
             # Keep track of the error for the retry warning.
@@ -673,23 +706,25 @@ class HTTPSConnectionPool(HTTPConnectionPool):
                           assert_fingerprint=self.assert_fingerprint)
             conn.ssl_version = self.ssl_version
 
-        if self.proxy is not None:
-            # Python 2.7+
-            try:
-                set_tunnel = conn.set_tunnel
-            except AttributeError:  # Platform-specific: Python 2.6
-                set_tunnel = conn._set_tunnel
+        return conn
 
-            if sys.version_info <= (2, 6, 4) and not self.proxy_headers:   # Python 2.6.4 and older
-                set_tunnel(self.host, self.port)
-            else:
-                set_tunnel(self.host, self.port, self.proxy_headers)
+    def _prepare_proxy(self, conn):
+        """
+        Establish tunnel connection early, because otherwise httplib
+        would improperly set Host: header to proxy's IP:port.
+        """
+        # Python 2.7+
+        try:
+            set_tunnel = conn.set_tunnel
+        except AttributeError:  # Platform-specific: Python 2.6
+            set_tunnel = conn._set_tunnel
 
-            # Establish tunnel connection early, because otherwise httplib
-            # would improperly set Host: header to proxy's IP:port.
-            conn.connect()
+        if sys.version_info <= (2, 6, 4) and not self.proxy_headers:   # Python 2.6.4 and older
+            set_tunnel(self.host, self.port)
+        else:
+            set_tunnel(self.host, self.port, self.proxy_headers)
 
-        return conn
+        conn.connect()
 
     def _new_conn(self):
         """

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/contrib/__init__.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/contrib/__init__.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/contrib/ntlmpool.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/contrib/ntlmpool.py


+ 5 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/contrib/pyopenssl.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/contrib/pyopenssl.py

@@ -191,6 +191,11 @@ class WrappedSocket(object):
                 return b''
             else:
                 raise
+        except OpenSSL.SSL.ZeroReturnError as e:
+            if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN:
+                return b''
+            else:
+                raise
         except OpenSSL.SSL.WantReadError:
             rd, wd, ed = select.select(
                 [self.socket], [], [], self.socket.gettimeout())

+ 5 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/exceptions.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/exceptions.py

@@ -157,3 +157,8 @@ class InsecureRequestWarning(SecurityWarning):
 class SystemTimeWarning(SecurityWarning):
     "Warned when system time is suspected to be wrong"
     pass
+
+
+class InsecurePlatformWarning(SecurityWarning):
+    "Warned when certain SSL configuration is not available on a platform."
+    pass

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/fields.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/fields.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/filepost.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/filepost.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/packages/__init__.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/__init__.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/packages/ordered_dict.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/ordered_dict.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/packages/six.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/six.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py


+ 17 - 2
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/poolmanager.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/poolmanager.py

@@ -8,7 +8,7 @@ except ImportError:
 from ._collections import RecentlyUsedContainer
 from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
 from .connectionpool import port_by_scheme
-from .exceptions import LocationValueError
+from .exceptions import LocationValueError, MaxRetryError
 from .request import RequestMethods
 from .util.url import parse_url
 from .util.retry import Retry
@@ -64,6 +64,14 @@ class PoolManager(RequestMethods):
         self.pools = RecentlyUsedContainer(num_pools,
                                            dispose_func=lambda p: p.close())
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        self.clear()
+        # Return False to re-raise any potential exceptions
+        return False
+
     def _new_pool(self, scheme, host, port):
         """
         Create a new :class:`ConnectionPool` based on host, port and scheme.
@@ -167,7 +175,14 @@ class PoolManager(RequestMethods):
         if not isinstance(retries, Retry):
             retries = Retry.from_int(retries, redirect=redirect)
 
-        kw['retries'] = retries.increment(method, redirect_location)
+        try:
+            retries = retries.increment(method, url, response=response, _pool=conn)
+        except MaxRetryError:
+            if retries.raise_on_redirect:
+                raise
+            return response
+
+        kw['retries'] = retries
         kw['redirect'] = redirect
 
         log.info("Redirecting %s -> %s" % (url, redirect_location))

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/request.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/request.py


+ 32 - 12
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/response.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/response.py

@@ -4,12 +4,11 @@ from socket import timeout as SocketTimeout
 
 from ._collections import HTTPHeaderDict
 from .exceptions import ProtocolError, DecodeError, ReadTimeoutError
-from .packages.six import string_types as basestring, binary_type
+from .packages.six import string_types as basestring, binary_type, PY3
 from .connection import HTTPException, BaseSSLError
 from .util.response import is_fp_closed
 
 
-
 class DeflateDecoder(object):
 
     def __init__(self):
@@ -21,6 +20,9 @@ class DeflateDecoder(object):
         return getattr(self._obj, name)
 
     def decompress(self, data):
+        if not data:
+            return data
+
         if not self._first_try:
             return self._obj.decompress(data)
 
@@ -36,9 +38,23 @@ class DeflateDecoder(object):
                 self._data = None
 
 
+class GzipDecoder(object):
+
+    def __init__(self):
+        self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS)
+
+    def __getattr__(self, name):
+        return getattr(self._obj, name)
+
+    def decompress(self, data):
+        if not data:
+            return data
+        return self._obj.decompress(data)
+
+
 def _get_decoder(mode):
     if mode == 'gzip':
-        return zlib.decompressobj(16 + zlib.MAX_WBITS)
+        return GzipDecoder()
 
     return DeflateDecoder()
 
@@ -76,9 +92,10 @@ class HTTPResponse(io.IOBase):
                  strict=0, preload_content=True, decode_content=True,
                  original_response=None, pool=None, connection=None):
 
-        self.headers = HTTPHeaderDict()
-        if headers:
-            self.headers.update(headers)
+        if isinstance(headers, HTTPHeaderDict):
+            self.headers = headers
+        else:
+            self.headers = HTTPHeaderDict(headers)
         self.status = status
         self.version = version
         self.reason = reason
@@ -202,7 +219,7 @@ class HTTPResponse(io.IOBase):
 
             except BaseSSLError as e:
                 # FIXME: Is there a better way to differentiate between SSLErrors?
-                if not 'read operation timed out' in str(e):  # Defensive:
+                if 'read operation timed out' not in str(e):  # Defensive:
                     # This shouldn't happen but just in case we're missing an edge
                     # case, let's avoid swallowing SSL errors.
                     raise
@@ -267,14 +284,16 @@ class HTTPResponse(io.IOBase):
         Remaining parameters are passed to the HTTPResponse constructor, along
         with ``original_response=r``.
         """
-
-        headers = HTTPHeaderDict()
-        for k, v in r.getheaders():
-            headers.add(k, v)
+        headers = r.msg
+        if not isinstance(headers, HTTPHeaderDict):
+            if PY3: # Python 3
+                headers = HTTPHeaderDict(headers.items())
+            else: # Python 2
+                headers = HTTPHeaderDict.from_httplib(headers)
 
         # HTTPResponse objects in Python 3 don't have a .strict attribute
         strict = getattr(r, 'strict', 0)
-        return ResponseCls(body=r,
+        resp = ResponseCls(body=r,
                            headers=headers,
                            status=r.status,
                            version=r.version,
@@ -282,6 +301,7 @@ class HTTPResponse(io.IOBase):
                            strict=strict,
                            original_response=r,
                            **response_kw)
+        return resp
 
     # Backwards-compatibility methods for httplib.HTTPResponse
     def getheaders(self):

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/__init__.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/__init__.py


+ 1 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/connection.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/connection.py

@@ -82,6 +82,7 @@ def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
             err = _
             if sock is not None:
                 sock.close()
+                sock = None
 
     if err is not None:
         raise err

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/request.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/request.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/response.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/response.py


+ 1 - 1
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/retry.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/retry.py

@@ -190,7 +190,7 @@ class Retry(object):
         return isinstance(err, (ReadTimeoutError, ProtocolError))
 
     def is_forced_retry(self, method, status_code):
-        """ Is this method/response retryable? (Based on method/codes whitelists)
+        """ Is this method/status code retryable? (Based on method/codes whitelists)
         """
         if self.method_whitelist and method.upper() not in self.method_whitelist:
             return False

+ 18 - 6
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/ssl_.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/ssl_.py

@@ -1,7 +1,7 @@
 from binascii import hexlify, unhexlify
-from hashlib import md5, sha1
+from hashlib import md5, sha1, sha256
 
-from ..exceptions import SSLError
+from ..exceptions import SSLError, InsecurePlatformWarning
 
 
 SSLContext = None
@@ -10,6 +10,7 @@ create_default_context = None
 
 import errno
 import ssl
+import warnings
 
 try:  # Test for SSL features
     from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23
@@ -29,8 +30,8 @@ try:
 except ImportError:
     _DEFAULT_CIPHERS = (
         'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
-        'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:ECDH+RC4:'
-        'DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'
+        'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'
+        '!eNULL:!MD5'
     )
 
 try:
@@ -69,6 +70,14 @@ except ImportError:
             self.ciphers = cipher_suite
 
         def wrap_socket(self, socket, server_hostname=None):
+            warnings.warn(
+                'A true SSLContext object is not available. This prevents '
+                'urllib3 from configuring SSL appropriately and may cause '
+                'certain SSL connections to fail. For more information, see '
+                'https://urllib3.readthedocs.org/en/latest/security.html'
+                '#insecureplatformwarning.',
+                InsecurePlatformWarning
+            )
             kwargs = {
                 'keyfile': self.keyfile,
                 'certfile': self.certfile,
@@ -96,7 +105,8 @@ def assert_fingerprint(cert, fingerprint):
     # this digest.
     hashfunc_map = {
         16: md5,
-        20: sha1
+        20: sha1,
+        32: sha256,
     }
 
     fingerprint = fingerprint.replace(':', '').lower()
@@ -211,7 +221,9 @@ def create_urllib3_context(ssl_version=None, cert_reqs=ssl.CERT_REQUIRED,
 
     context.verify_mode = cert_reqs
     if getattr(context, 'check_hostname', None) is not None:  # Platform-specific: Python 3.2
-        context.check_hostname = (context.verify_mode == ssl.CERT_REQUIRED)
+        # We do our own verification, including fingerprints and alternative
+        # hostnames. So disable it here
+        context.check_hostname = False
     return context
 
 

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/timeout.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/timeout.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/packages/urllib3/util/url.py → desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/util/url.py


+ 4 - 1
desktop/core/ext-py/requests-2.5.1/requests/sessions.py → desktop/core/ext-py/requests-2.6.0/requests/sessions.py

@@ -171,7 +171,10 @@ class SessionRedirectMixin(object):
             except KeyError:
                 pass
 
-            extract_cookies_to_jar(prepared_request._cookies, prepared_request, resp.raw)
+            # Extract any cookies sent on the response to the cookiejar
+            # in the new request. Because we've mutated our copied prepared
+            # request, use the old one that we haven't yet touched.
+            extract_cookies_to_jar(prepared_request._cookies, req, resp.raw)
             prepared_request._cookies.update(self.cookies)
             prepared_request.prepare_cookies(prepared_request._cookies)
 

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/status_codes.py → desktop/core/ext-py/requests-2.6.0/requests/status_codes.py


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requests/structures.py → desktop/core/ext-py/requests-2.6.0/requests/structures.py


+ 16 - 6
desktop/core/ext-py/requests-2.5.1/requests/utils.py → desktop/core/ext-py/requests-2.6.0/requests/utils.py

@@ -25,7 +25,8 @@ from . import __version__
 from . import certs
 from .compat import parse_http_list as _parse_list_header
 from .compat import (quote, urlparse, bytes, str, OrderedDict, unquote, is_py2,
-                     builtin_str, getproxies, proxy_bypass, urlunparse)
+                     builtin_str, getproxies, proxy_bypass, urlunparse,
+                     basestring)
 from .cookies import RequestsCookieJar, cookiejar_from_dict
 from .structures import CaseInsensitiveDict
 from .exceptions import InvalidURL
@@ -115,7 +116,8 @@ def get_netrc_auth(url):
 def guess_filename(obj):
     """Tries to guess the filename of the given object."""
     name = getattr(obj, 'name', None)
-    if name and isinstance(name, builtin_str) and name[0] != '<' and name[-1] != '>':
+    if (name and isinstance(name, basestring) and name[0] != '<' and
+            name[-1] != '>'):
         return os.path.basename(name)
 
 
@@ -418,10 +420,18 @@ def requote_uri(uri):
     This function passes the given URI through an unquote/quote cycle to
     ensure that it is fully and consistently quoted.
     """
-    # Unquote only the unreserved characters
-    # Then quote only illegal characters (do not quote reserved, unreserved,
-    # or '%')
-    return quote(unquote_unreserved(uri), safe="!#$%&'()*+,/:;=?@[]~")
+    safe_with_percent = "!#$%&'()*+,/:;=?@[]~"
+    safe_without_percent = "!#$&'()*+,/:;=?@[]~"
+    try:
+        # Unquote only the unreserved characters
+        # Then quote only illegal characters (do not quote reserved,
+        # unreserved, or '%')
+        return quote(unquote_unreserved(uri), safe=safe_with_percent)
+    except InvalidURL:
+        # We couldn't unquote the given URI, so let's try quoting it, but
+        # there may be unquoted '%'s in the URI. We need to make sure they're
+        # properly quoted so they do not cause issues elsewhere.
+        return quote(uri, safe=safe_without_percent)
 
 
 def address_in_network(ip, net):

+ 0 - 0
desktop/core/ext-py/requests-2.5.1/requirements.txt → desktop/core/ext-py/requests-2.6.0/requirements.txt


+ 0 - 0
desktop/core/ext-py/requests-2.5.1/setup.cfg → desktop/core/ext-py/requests-2.6.0/setup.cfg


+ 14 - 4
desktop/core/ext-py/requests-2.5.1/setup.py → desktop/core/ext-py/requests-2.6.0/setup.py

@@ -1,10 +1,9 @@
 #!/usr/bin/env python
 
 import os
+import re
 import sys
 
-import requests
-
 from codecs import open
 
 try:
@@ -29,6 +28,18 @@ packages = [
 
 requires = []
 
+version = ''
+with open('requests/__init__.py', 'r') as fd:
+    reg = re.compile(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]')
+    for line in fd:
+        m = reg.match(line)
+        if m:
+            version = m.group(1)
+            break
+
+if not version:
+    raise RuntimeError('Cannot find version information')
+
 with open('README.rst', 'r', 'utf-8') as f:
     readme = f.read()
 with open('HISTORY.rst', 'r', 'utf-8') as f:
@@ -36,7 +47,7 @@ with open('HISTORY.rst', 'r', 'utf-8') as f:
 
 setup(
     name='requests',
-    version=requests.__version__,
+    version=version,
     description='Python HTTP for Humans.',
     long_description=readme + '\n\n' + history,
     author='Kenneth Reitz',
@@ -60,7 +71,6 @@ setup(
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.3',
         'Programming Language :: Python :: 3.4'
-
     ),
     extras_require={
         'security': ['pyOpenSSL', 'ndg-httpsclient', 'pyasn1'],

+ 84 - 3
desktop/core/ext-py/requests-2.5.1/test_requests.py → desktop/core/ext-py/requests-2.6.0/test_requests.py

@@ -301,13 +301,15 @@ class RequestsTestCase(unittest.TestCase):
         r = s.get(url)
         assert r.status_code == 200
 
-    def test_connection_error(self):
+    def test_connection_error_invalid_domain(self):
         """Connecting to an unknown domain should raise a ConnectionError"""
         with pytest.raises(ConnectionError):
-            requests.get("http://fooobarbangbazbing.httpbin.org")
+            requests.get("http://doesnotexist.google.com")
 
+    def test_connection_error_invalid_port(self):
+        """Connecting to an invalid port should raise a ConnectionError"""
         with pytest.raises(ConnectionError):
-            requests.get("http://httpbin.org:1")
+            requests.get("http://httpbin.org:1", timeout=1)
 
     def test_LocationParseError(self):
         """Inputing a URL that cannot be parsed should raise an InvalidURL error"""
@@ -933,6 +935,19 @@ class RequestsTestCase(unittest.TestCase):
 
         assert 'multipart/form-data' in p.headers['Content-Type']
 
+    def test_can_send_bytes_bytearray_objects_with_files(self):
+        # Test bytes:
+        data = {'a': 'this is a string'}
+        files = {'b': b'foo'}
+        r = requests.Request('POST', httpbin('post'), data=data, files=files)
+        p = r.prepare()
+        assert 'multipart/form-data' in p.headers['Content-Type']
+        # Test bytearrays:
+        files = {'b': bytearray(b'foo')}
+        r = requests.Request('POST', httpbin('post'), data=data, files=files)
+        p = r.prepare()
+        assert 'multipart/form-data' in p.headers['Content-Type']
+
     def test_can_send_file_object_with_non_string_filename(self):
         f = io.BytesIO()
         f.name = 2
@@ -1037,6 +1052,23 @@ class RequestsTestCase(unittest.TestCase):
         assert 'application/json' in r.request.headers['Content-Type']
         assert {'life': 42} == r.json()['json']
 
+    def test_response_iter_lines(self):
+        r = requests.get(httpbin('stream/4'), stream=True)
+        assert r.status_code == 200
+
+        it = r.iter_lines()
+        next(it)
+        assert len(list(it)) == 3
+
+    @pytest.mark.xfail
+    def test_response_iter_lines_reentrant(self):
+        """Response.iter_lines() is not reentrant safe"""
+        r = requests.get(httpbin('stream/4'), stream=True)
+        assert r.status_code == 200
+
+        next(r.iter_lines())
+        assert len(list(r.iter_lines())) == 3
+
 
 class TestContentEncodingDetection(unittest.TestCase):
 
@@ -1265,6 +1297,32 @@ class UtilsTestCase(unittest.TestCase):
             'http://localhost.localdomain:5000/v1.0/') == {}
         assert get_environ_proxies('http://www.requests.com/') != {}
 
+    def test_guess_filename_when_int(self):
+        from requests.utils import guess_filename
+        assert None is guess_filename(1)
+
+    def test_guess_filename_when_filename_is_an_int(self):
+        from requests.utils import guess_filename
+        fake = type('Fake', (object,), {'name': 1})()
+        assert None is guess_filename(fake)
+
+    def test_guess_filename_with_file_like_obj(self):
+        from requests.utils import guess_filename
+        from requests import compat
+        fake = type('Fake', (object,), {'name': b'value'})()
+        guessed_name = guess_filename(fake)
+        assert b'value' == guessed_name
+        assert isinstance(guessed_name, compat.bytes)
+
+    def test_guess_filename_with_unicode_name(self):
+        from requests.utils import guess_filename
+        from requests import compat
+        filename = b'value'.decode('utf-8')
+        fake = type('Fake', (object,), {'name': filename})()
+        guessed_name = guess_filename(fake)
+        assert filename == guessed_name
+        assert isinstance(guessed_name, compat.str)
+
     def test_is_ipv4_address(self):
         from requests.utils import is_ipv4_address
         assert is_ipv4_address('8.8.8.8')
@@ -1301,6 +1359,22 @@ class UtilsTestCase(unittest.TestCase):
         assert username == percent_encoding_test_chars
         assert password == percent_encoding_test_chars
 
+    def test_requote_uri_with_unquoted_percents(self):
+        """Ensure we handle unquoted percent signs in redirects.
+
+        See: https://github.com/kennethreitz/requests/issues/2356
+        """
+        from requests.utils import requote_uri
+        bad_uri = 'http://example.com/fiz?buz=%ppicture'
+        quoted = 'http://example.com/fiz?buz=%25ppicture'
+        assert quoted == requote_uri(bad_uri)
+
+    def test_requote_uri_properly_requotes(self):
+        """Ensure requoting doesn't break expectations."""
+        from requests.utils import requote_uri
+        quoted = 'http://example.com/fiz?buz=%25ppicture'
+        assert quoted == requote_uri(quoted)
+
 
 class TestMorselToCookieExpires(unittest.TestCase):
 
@@ -1554,5 +1628,12 @@ def test_urllib3_retries():
     with pytest.raises(RetryError):
         s.get(httpbin('status/500'))
 
+def test_vendor_aliases():
+    from requests.packages import urllib3
+    from requests.packages import chardet
+
+    with pytest.raises(ImportError):
+        from requests.packages import webbrowser
+
 if __name__ == '__main__':
     unittest.main()