Update urllib3 to 59de03e6163c6928dc01832ed6e48e9f6c34c795.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This update includes two fixes: * https://github.com/shazow/urllib3/issues/149 * https://github.com/shazow/urllib3/issues/174
authored by Bryce Boe · committed by Bryce Boe · parent d2ba579 · Browse files · 9 files·+31 added−19 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+31 added−19 removed
- other:+31 added−19 removed
Provenance
- Commit
49ca72c- Tree
3fc6648- Author
Bryce Boe <bbzbryce@gmail.com>- Committer
Bryce Boe <bbzbryce@gmail.com>- Parent
d2ba579
9 files changed+31 added−19 removed
modified:requests/packages/urllib3/contrib/ntlmpool.py+1 added-1 removed
1 # urllib3/contrib/ntlmpool.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 114 unmodified linesmodified:requests/packages/urllib3/__init__.py+1 added-1 removed
1 # urllib3/__init__.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 52 unmodified linesmodified:requests/packages/urllib3/_collections.py+1 added-1 removed
1 # urllib3/_collections.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 88 unmodified linesmodified:requests/packages/urllib3/connectionpool.py+5 added-3 removed
1 # urllib3/connectionpool.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 438 unmodified lines445 # ``response.read()``)446 447 except Empty as e:448 # Timed out by queue449- raise TimeoutError(self, "Request timed out. (pool_timeout=%s)" %449+ raise TimeoutError(self, url,450+ "Request timed out. (pool_timeout=%s)" %451 pool_timeout)452 453 except SocketTimeout as e:454 # Timed out by socket454- raise TimeoutError(self, "Request timed out. (timeout=%s)" %455+ raise TimeoutError(self, url,456+ "Request timed out. (timeout=%s)" %457 timeout)458 459 except BaseSSLError as e:460 # SSL certificate error137 unmodified linesmodified:requests/packages/urllib3/exceptions.py+18 added-10 removed
1 # urllib3/exceptions.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 12 unmodified lines19 HTTPError.__init__(self, "%s: %s" % (pool, message))20 21 def __reduce__(self):22 # For pickling purposes.23- return self.__class__, (None, self.url)23+ return self.__class__, (None, None)24 25 26+class RequestError(PoolError):27+ "Base exception for PoolErrors that have associated URLs."28+ def __init__(self, pool, url, message):29+ self.url = url30+ PoolError.__init__(self, pool, message)31+32+ def __reduce__(self):33+ # For pickling purposes.34+ return self.__class__, (None, self.url, None)35+36+37 class SSLError(HTTPError):38 "Raised when SSL certificate fails in an HTTPS connection."39 pass40 4 unmodified lines45 46 47 ## Leaf Exceptions48 38-class MaxRetryError(PoolError):49+class MaxRetryError(RequestError):50 "Raised when the maximum number of retries is exceeded."51 52 def __init__(self, pool, url, reason=None):53 self.reason = reason3 unmodified lines57 message += " (Caused by %s: %s)" % (type(reason), reason)58 else:59 message += " (Caused by redirect)"60 50- PoolError.__init__(self, pool, message)51- self.url = url61+ RequestError.__init__(self, pool, url, message)62 63 54-class HostChangedError(PoolError):64+class HostChangedError(RequestError):65 "Raised when an existing pool gets a request for a foreign host."66 67 def __init__(self, pool, url, retries=3):68 message = "Tried to open a foreign host with url: %s" % url59- PoolError.__init__(self, pool, message)60-61- self.url = url69+ RequestError.__init__(self, pool, url, message)70 self.retries = retries71 72 65-class TimeoutError(PoolError):73+class TimeoutError(RequestError):74 "Raised when a socket timeout occurs."75 pass76 77 18 unmodified linesmodified:requests/packages/urllib3/poolmanager.py+2 added-1 removed
1 # urllib3/poolmanager.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 142 unmodified lines149 method = 'GET'150 151 log.info("Redirecting %s -> %s" % (url, redirect_location))152 kw['retries'] = kw.get('retries', 3) - 1 # Persist retries countdown153+ kw['redirect'] = redirect154 return self.urlopen(method, redirect_location, **kw)155 156 157 class ProxyManager(RequestMethods):35 unmodified linesmodified:requests/packages/urllib3/request.py+1 added-1 removed
1 # urllib3/request.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 136 unmodified linesmodified:requests/packages/urllib3/util.py+1 added-1 removed
1 # urllib3/util.py2-# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)2+# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)3 #4 # This module is part of urllib3 and is released under5 # the MIT License: http://www.opensource.org/licenses/mit-license.php6 372 unmodified linesmodified:AUTHORS.rst+1 added
121 unmodified lines122 - Johnny Goodnow <j.goodnow29@gmail.com>123 - Denis Ryzhkov <denisr@denisr.com>124 - Wilfred Hughes <me@wilfred.me.uk> @dontYetKnow125 - Dmitry Medvinsky <me@dmedvinsky.name>126+- Bryce Boe <bbzbryce@gmail.com> @bboe