[Python-modules-commits] [python-urllib3] 02/13: Import python-urllib3_1.15.1.orig.tar.gz
Daniele Tricoli
eriol-guest at moszumanska.debian.org
Tue May 10 01:03:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
eriol-guest pushed a commit to branch master
in repository python-urllib3.
commit 9105037e3d018d407e6b6faad26ae5a8a17a732a
Author: Daniele Tricoli <eriol at mornie.org>
Date: Sun May 8 02:18:15 2016 +0200
Import python-urllib3_1.15.1.orig.tar.gz
---
CHANGES.rst | 107 +++--
CONTRIBUTORS.txt | 13 +
LICENSE.txt | 2 +-
PKG-INFO | 127 ++++--
README.rst | 18 +-
dev-requirements.txt | 1 +
docs/contrib.rst | 56 ++-
docs/index.rst | 68 ++-
docs/recipes.rst | 41 ++
docs/security.rst | 10 +-
dummyserver/certs/client.pem | 31 +-
dummyserver/certs/server.crt | 31 +-
dummyserver/handlers.py | 5 +
dummyserver/server.py | 4 +-
dummyserver/testcase.py | 15 +
setup.cfg | 2 +-
setup.py | 19 +-
test/__init__.py | 14 +-
test/contrib/test_pyopenssl.py | 3 -
test/contrib/test_socks.py | 599 +++++++++++++++++++++++++
test/test_connection.py | 48 ++
test/test_connectionpool.py | 76 ++++
test/test_fields.py | 9 +-
test/with_dummyserver/test_chunked_transfer.py | 76 ++++
test/with_dummyserver/test_https.py | 39 +-
test/with_dummyserver/test_poolmanager.py | 28 ++
test/with_dummyserver/test_socketlevel.py | 151 ++++++-
urllib3.egg-info/PKG-INFO | 127 ++++--
urllib3.egg-info/SOURCES.txt | 7 +
urllib3.egg-info/pbr.json | 2 +-
urllib3.egg-info/requires.txt | 3 +
urllib3/__init__.py | 11 +-
urllib3/_collections.py | 2 +-
urllib3/connection.py | 64 ++-
urllib3/connectionpool.py | 93 ++--
urllib3/contrib/appengine.py | 12 +-
urllib3/contrib/ntlmpool.py | 20 +-
urllib3/contrib/pyopenssl.py | 64 ++-
urllib3/contrib/socks.py | 172 +++++++
urllib3/exceptions.py | 8 +
urllib3/fields.py | 4 +-
urllib3/packages/backports/__init__.py | 0
urllib3/packages/backports/makefile.py | 53 +++
urllib3/poolmanager.py | 17 +-
urllib3/response.py | 38 +-
urllib3/util/__init__.py | 2 +
urllib3/util/response.py | 2 +-
urllib3/util/retry.py | 14 +-
urllib3/util/ssl_.py | 11 +-
49 files changed, 2010 insertions(+), 309 deletions(-)
diff --git a/CHANGES.rst b/CHANGES.rst
index 674aa35..443379c 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,14 +1,53 @@
Changes
=======
+1.15.1 (2016-04-11)
+-------------------
+
+* Fix packaging to include backports module. (Issue #841)
+
+
+1.15 (2016-04-06)
+-----------------
+
+* Added Retry(raise_on_status=False). (Issue #720)
+
+* Always use setuptools, no more distutils fallback. (Issue #785)
+
+* Dropped support for Python 3.2. (Issue #786)
+
+* Chunked transfer encoding when requesting with ``chunked=True``.
+ (Issue #790)
+
+* Fixed regression with IPv6 port parsing. (Issue #801)
+
+* Append SNIMissingWarning messages to allow users to specify it in
+ the PYTHONWARNINGS environment variable. (Issue #816)
+
+* Handle unicode headers in Py2. (Issue #818)
+
+* Log certificate when there is a hostname mismatch. (Issue #820)
+
+* Preserve order of request/response headers. (Issue #821)
+
+
+1.14 (2015-12-29)
+-----------------
+
+* contrib: SOCKS proxy support! (Issue #762)
+
+* Fixed AppEngine handling of transfer-encoding header and bug
+ in Timeout defaults checking. (Issue #763)
+
+
1.13.1 (2015-12-18)
-+++++++++++++++++++
+-------------------
* Fixed regression in IPv6 + SSL for match_hostname. (Issue #761)
1.13 (2015-12-14)
-+++++++++++++++++
+-----------------
* Fixed ``pip install urllib3[secure]`` on modern pip. (Issue #706)
@@ -25,7 +64,7 @@ Changes
1.12 (2015-09-03)
-+++++++++++++++++
+-----------------
* Rely on ``six`` for importing ``httplib`` to work around
conflicts with other Python 3 shims. (Issue #688)
@@ -38,7 +77,7 @@ Changes
1.11 (2015-07-21)
-+++++++++++++++++
+-----------------
* When ``ca_certs`` is given, ``cert_reqs`` defaults to
``'CERT_REQUIRED'``. (Issue #650)
@@ -83,7 +122,7 @@ Changes
(Issue #674)
1.10.4 (2015-05-03)
-+++++++++++++++++++
+-------------------
* Migrate tests to Tornado 4. (Issue #594)
@@ -99,7 +138,7 @@ Changes
1.10.3 (2015-04-21)
-+++++++++++++++++++
+-------------------
* Emit ``InsecurePlatformWarning`` when SSLContext object is missing.
(Issue #558)
@@ -120,7 +159,7 @@ Changes
1.10.2 (2015-02-25)
-+++++++++++++++++++
+-------------------
* Fix file descriptor leakage on retries. (Issue #548)
@@ -132,7 +171,7 @@ Changes
1.10.1 (2015-02-10)
-+++++++++++++++++++
+-------------------
* Pools can be used as context managers. (Issue #545)
@@ -146,7 +185,7 @@ Changes
1.10 (2014-12-14)
-+++++++++++++++++
+-----------------
* Disabled SSLv3. (Issue #473)
@@ -178,7 +217,7 @@ Changes
1.9.1 (2014-09-13)
-++++++++++++++++++
+------------------
* Apply socket arguments before binding. (Issue #427)
@@ -199,7 +238,7 @@ Changes
1.9 (2014-07-04)
-++++++++++++++++
+----------------
* Shuffled around development-related files. If you're maintaining a distro
package of urllib3, you may need to tweak things. (Issue #415)
@@ -236,7 +275,7 @@ Changes
1.8.3 (2014-06-23)
-++++++++++++++++++
+------------------
* Fix TLS verification when using a proxy in Python 3.4.1. (Issue #385)
@@ -258,13 +297,13 @@ Changes
1.8.2 (2014-04-17)
-++++++++++++++++++
+------------------
* Fix ``urllib3.util`` not being included in the package.
1.8.1 (2014-04-17)
-++++++++++++++++++
+------------------
* Fix AppEngine bug of HTTPS requests going out as HTTP. (Issue #356)
@@ -275,7 +314,7 @@ Changes
1.8 (2014-03-04)
-++++++++++++++++
+----------------
* Improved url parsing in ``urllib3.util.parse_url`` (properly parse '@' in
username, and blank ports like 'hostname:').
@@ -327,7 +366,7 @@ Changes
1.7.1 (2013-09-25)
-++++++++++++++++++
+------------------
* Added granular timeout support with new ``urllib3.util.Timeout`` class.
(Issue #231)
@@ -336,7 +375,7 @@ Changes
1.7 (2013-08-14)
-++++++++++++++++
+----------------
* More exceptions are now pickle-able, with tests. (Issue #174)
@@ -375,7 +414,7 @@ Changes
1.6 (2013-04-25)
-++++++++++++++++
+----------------
* Contrib: Optional SNI support for Py2 using PyOpenSSL. (Issue #156)
@@ -435,7 +474,7 @@ Changes
1.5 (2012-08-02)
-++++++++++++++++
+----------------
* Added ``urllib3.add_stderr_logger()`` for quickly enabling STDERR debug
logging in urllib3.
@@ -460,7 +499,7 @@ Changes
1.4 (2012-06-16)
-++++++++++++++++
+----------------
* Minor AppEngine-related fixes.
@@ -472,7 +511,7 @@ Changes
1.3 (2012-03-25)
-++++++++++++++++
+----------------
* Removed pre-1.0 deprecated API.
@@ -491,13 +530,13 @@ Changes
1.2.2 (2012-02-06)
-++++++++++++++++++
+------------------
* Fixed packaging bug of not shipping ``test-requirements.txt``. (Issue #47)
1.2.1 (2012-02-05)
-++++++++++++++++++
+------------------
* Fixed another bug related to when ``ssl`` module is not available. (Issue #41)
@@ -506,7 +545,7 @@ Changes
1.2 (2012-01-29)
-++++++++++++++++
+----------------
* Added Python 3 support (tested on 3.2.2)
@@ -532,7 +571,7 @@ Changes
1.1 (2012-01-07)
-++++++++++++++++
+----------------
* Refactored ``dummyserver`` to its own root namespace module (used for
testing).
@@ -549,7 +588,7 @@ Changes
1.0.2 (2011-11-04)
-++++++++++++++++++
+------------------
* Fixed typo in ``VerifiedHTTPSConnection`` which would only present as a bug if
you're using the object manually. (Thanks pyos)
@@ -562,14 +601,14 @@ Changes
1.0.1 (2011-10-10)
-++++++++++++++++++
+------------------
* Fixed a bug where the same connection would get returned into the pool twice,
causing extraneous "HttpConnectionPool is full" log warnings.
1.0 (2011-10-08)
-++++++++++++++++
+----------------
* Added ``PoolManager`` with LRU expiration of connections (tested and
documented).
@@ -592,13 +631,13 @@ Changes
0.4.1 (2011-07-17)
-++++++++++++++++++
+------------------
* Minor bug fixes, code cleanup.
0.4 (2011-03-01)
-++++++++++++++++
+----------------
* Better unicode support.
* Added ``VerifiedHTTPSConnection``.
@@ -607,13 +646,13 @@ Changes
0.3.1 (2010-07-13)
-++++++++++++++++++
+------------------
* Added ``assert_host_name`` optional parameter. Now compatible with proxies.
0.3 (2009-12-10)
-++++++++++++++++
+----------------
* Added HTTPS support.
* Minor bug fixes.
@@ -622,13 +661,13 @@ Changes
0.2 (2008-11-17)
-++++++++++++++++
+----------------
* Added unit tests.
* Bug fixes.
0.1 (2008-11-16)
-++++++++++++++++
+----------------
* First release.
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 448a4ab..d9a20ee 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -184,5 +184,18 @@ In chronological order:
* Andy Caldwell <andy.m.caldwell at googlemail.com>
* Bugfix related to reusing connections in indeterminate states.
+* Ville Skyttä <ville.skytta at iki.fi>
+ * Logging efficiency improvements, spelling fixes, Travis config.
+
+* Shige Takeda <smtakeda at gmail.com>
+ * Started Recipes documentation and added a recipe about handling concatenated gzip data in HTTP response
+
+* Jesse Shapiro <jesse at jesseshapiro.net>
+ * Working on encoding unicode header parameter names
+ * Making setup.py resilient to ASCII locales
+
+* David Foster <http://dafoster.net/>
+ * Ensure order of request and response headers are preserved.
+
* [Your name or handle] <[email or website]>
* [Brief summary of your changes]
diff --git a/LICENSE.txt b/LICENSE.txt
index 2a02593..1c3283e 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
This is the MIT license: http://www.opensource.org/licenses/mit-license.php
-Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
+Copyright 2008-2016 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
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
diff --git a/PKG-INFO b/PKG-INFO
index a375cfe..878f9c4 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: urllib3
-Version: 1.13.1
+Version: 1.15.1
Summary: HTTP library with thread-safe connection pooling, file post, and more.
Home-page: http://urllib3.readthedocs.org/
Author: Andrey Petrov
@@ -26,9 +26,10 @@ Description: =======
- File posting (``encode_multipart_formdata``).
- Built-in redirection and retries (optional).
- Supports gzip and deflate decoding.
+ - Proxy over HTTP or SOCKS.
- Thread-safe and sanity-safe.
- Works with AppEngine, gevent, and eventlib.
- - Tested on Python 2.6+, Python 3.2+, and PyPy, with 100% unit test coverage.
+ - Tested on Python 2.6+, Python 3.3+, and PyPy, with 100% unit test coverage.
- Small and easy to understand codebase perfect for extending and building upon.
For a more comprehensive solution, have a look at
`Requests <http://python-requests.org/>`_ which is also powered by ``urllib3``.
@@ -134,6 +135,21 @@ Description: =======
Contributing
============
+ Thank you for giving back to urllib3. Please meet our jolly team
+ of code-sherpas:
+
+ Maintainers
+ -----------
+
+ - `@lukasa <https://github.com/lukasa>`_ (Cory Benfield)
+ - `@sigmavirus24 <https://github.com/sigmavirus24>`_ (Ian Cordasco)
+ - `@shazow <https://github.com/shazow>`_ (Andrey Petrov)
+
+ 👋
+
+ Getting Started
+ ---------------
+
#. `Check for open issues <https://github.com/shazow/urllib3/issues>`_ or open
a fresh issue to start a discussion around a feature idea or a bug. There is
a *Contributor Friendly* tag for issues that should be ideal for people who
@@ -156,14 +172,53 @@ Description: =======
Changes
=======
+ 1.15.1 (2016-04-11)
+ -------------------
+
+ * Fix packaging to include backports module. (Issue #841)
+
+
+ 1.15 (2016-04-06)
+ -----------------
+
+ * Added Retry(raise_on_status=False). (Issue #720)
+
+ * Always use setuptools, no more distutils fallback. (Issue #785)
+
+ * Dropped support for Python 3.2. (Issue #786)
+
+ * Chunked transfer encoding when requesting with ``chunked=True``.
+ (Issue #790)
+
+ * Fixed regression with IPv6 port parsing. (Issue #801)
+
+ * Append SNIMissingWarning messages to allow users to specify it in
+ the PYTHONWARNINGS environment variable. (Issue #816)
+
+ * Handle unicode headers in Py2. (Issue #818)
+
+ * Log certificate when there is a hostname mismatch. (Issue #820)
+
+ * Preserve order of request/response headers. (Issue #821)
+
+
+ 1.14 (2015-12-29)
+ -----------------
+
+ * contrib: SOCKS proxy support! (Issue #762)
+
+ * Fixed AppEngine handling of transfer-encoding header and bug
+ in Timeout defaults checking. (Issue #763)
+
+
1.13.1 (2015-12-18)
- +++++++++++++++++++
+ -------------------
* Fixed regression in IPv6 + SSL for match_hostname. (Issue #761)
1.13 (2015-12-14)
- +++++++++++++++++
+ -----------------
* Fixed ``pip install urllib3[secure]`` on modern pip. (Issue #706)
@@ -180,7 +235,7 @@ Description: =======
1.12 (2015-09-03)
- +++++++++++++++++
+ -----------------
* Rely on ``six`` for importing ``httplib`` to work around
conflicts with other Python 3 shims. (Issue #688)
@@ -193,7 +248,7 @@ Description: =======
1.11 (2015-07-21)
- +++++++++++++++++
+ -----------------
* When ``ca_certs`` is given, ``cert_reqs`` defaults to
``'CERT_REQUIRED'``. (Issue #650)
@@ -238,7 +293,7 @@ Description: =======
(Issue #674)
1.10.4 (2015-05-03)
- +++++++++++++++++++
+ -------------------
* Migrate tests to Tornado 4. (Issue #594)
@@ -254,7 +309,7 @@ Description: =======
1.10.3 (2015-04-21)
- +++++++++++++++++++
+ -------------------
* Emit ``InsecurePlatformWarning`` when SSLContext object is missing.
(Issue #558)
@@ -275,7 +330,7 @@ Description: =======
1.10.2 (2015-02-25)
- +++++++++++++++++++
+ -------------------
* Fix file descriptor leakage on retries. (Issue #548)
@@ -287,7 +342,7 @@ Description: =======
1.10.1 (2015-02-10)
- +++++++++++++++++++
+ -------------------
* Pools can be used as context managers. (Issue #545)
@@ -301,7 +356,7 @@ Description: =======
1.10 (2014-12-14)
- +++++++++++++++++
+ -----------------
* Disabled SSLv3. (Issue #473)
@@ -333,7 +388,7 @@ Description: =======
1.9.1 (2014-09-13)
- ++++++++++++++++++
+ ------------------
* Apply socket arguments before binding. (Issue #427)
@@ -354,7 +409,7 @@ Description: =======
1.9 (2014-07-04)
- ++++++++++++++++
+ ----------------
* Shuffled around development-related files. If you're maintaining a distro
package of urllib3, you may need to tweak things. (Issue #415)
@@ -391,7 +446,7 @@ Description: =======
1.8.3 (2014-06-23)
- ++++++++++++++++++
+ ------------------
* Fix TLS verification when using a proxy in Python 3.4.1. (Issue #385)
@@ -413,13 +468,13 @@ Description: =======
1.8.2 (2014-04-17)
- ++++++++++++++++++
+ ------------------
* Fix ``urllib3.util`` not being included in the package.
1.8.1 (2014-04-17)
- ++++++++++++++++++
+ ------------------
* Fix AppEngine bug of HTTPS requests going out as HTTP. (Issue #356)
@@ -430,7 +485,7 @@ Description: =======
1.8 (2014-03-04)
- ++++++++++++++++
+ ----------------
* Improved url parsing in ``urllib3.util.parse_url`` (properly parse '@' in
username, and blank ports like 'hostname:').
@@ -482,7 +537,7 @@ Description: =======
1.7.1 (2013-09-25)
- ++++++++++++++++++
+ ------------------
* Added granular timeout support with new ``urllib3.util.Timeout`` class.
(Issue #231)
@@ -491,7 +546,7 @@ Description: =======
1.7 (2013-08-14)
- ++++++++++++++++
+ ----------------
* More exceptions are now pickle-able, with tests. (Issue #174)
@@ -530,7 +585,7 @@ Description: =======
1.6 (2013-04-25)
- ++++++++++++++++
+ ----------------
* Contrib: Optional SNI support for Py2 using PyOpenSSL. (Issue #156)
@@ -590,7 +645,7 @@ Description: =======
1.5 (2012-08-02)
- ++++++++++++++++
+ ----------------
* Added ``urllib3.add_stderr_logger()`` for quickly enabling STDERR debug
logging in urllib3.
@@ -615,7 +670,7 @@ Description: =======
1.4 (2012-06-16)
- ++++++++++++++++
+ ----------------
* Minor AppEngine-related fixes.
@@ -627,7 +682,7 @@ Description: =======
1.3 (2012-03-25)
- ++++++++++++++++
+ ----------------
* Removed pre-1.0 deprecated API.
@@ -646,13 +701,13 @@ Description: =======
1.2.2 (2012-02-06)
- ++++++++++++++++++
+ ------------------
* Fixed packaging bug of not shipping ``test-requirements.txt``. (Issue #47)
1.2.1 (2012-02-05)
- ++++++++++++++++++
+ ------------------
* Fixed another bug related to when ``ssl`` module is not available. (Issue #41)
@@ -661,7 +716,7 @@ Description: =======
1.2 (2012-01-29)
- ++++++++++++++++
+ ----------------
* Added Python 3 support (tested on 3.2.2)
@@ -687,7 +742,7 @@ Description: =======
1.1 (2012-01-07)
- ++++++++++++++++
+ ----------------
* Refactored ``dummyserver`` to its own root namespace module (used for
testing).
@@ -704,7 +759,7 @@ Description: =======
1.0.2 (2011-11-04)
- ++++++++++++++++++
+ ------------------
* Fixed typo in ``VerifiedHTTPSConnection`` which would only present as a bug if
you're using the object manually. (Thanks pyos)
@@ -717,14 +772,14 @@ Description: =======
1.0.1 (2011-10-10)
- ++++++++++++++++++
+ ------------------
* Fixed a bug where the same connection would get returned into the pool twice,
causing extraneous "HttpConnectionPool is full" log warnings.
1.0 (2011-10-08)
- ++++++++++++++++
+ ----------------
* Added ``PoolManager`` with LRU expiration of connections (tested and
documented).
@@ -747,13 +802,13 @@ Description: =======
0.4.1 (2011-07-17)
- ++++++++++++++++++
+ ------------------
* Minor bug fixes, code cleanup.
0.4 (2011-03-01)
- ++++++++++++++++
+ ----------------
* Better unicode support.
* Added ``VerifiedHTTPSConnection``.
@@ -762,13 +817,13 @@ Description: =======
0.3.1 (2010-07-13)
- ++++++++++++++++++
+ ------------------
* Added ``assert_host_name`` optional parameter. Now compatible with proxies.
0.3 (2009-12-10)
- ++++++++++++++++
+ ----------------
* Added HTTPS support.
* Minor bug fixes.
@@ -777,14 +832,14 @@ Description: =======
0.2 (2008-11-17)
- ++++++++++++++++
+ ----------------
* Added unit tests.
* Bug fixes.
0.1 (2008-11-16)
- ++++++++++++++++
+ ----------------
* First release.
diff --git a/README.rst b/README.rst
index fc6bccf..41e4cee 100644
--- a/README.rst
+++ b/README.rst
@@ -18,9 +18,10 @@ Highlights
- File posting (``encode_multipart_formdata``).
- Built-in redirection and retries (optional).
- Supports gzip and deflate decoding.
+- Proxy over HTTP or SOCKS.
- Thread-safe and sanity-safe.
- Works with AppEngine, gevent, and eventlib.
-- Tested on Python 2.6+, Python 3.2+, and PyPy, with 100% unit test coverage.
+- Tested on Python 2.6+, Python 3.3+, and PyPy, with 100% unit test coverage.
- Small and easy to understand codebase perfect for extending and building upon.
For a more comprehensive solution, have a look at
`Requests <http://python-requests.org/>`_ which is also powered by ``urllib3``.
@@ -126,6 +127,21 @@ Our test suite `runs continuously on Travis CI
Contributing
============
+Thank you for giving back to urllib3. Please meet our jolly team
+of code-sherpas:
+
+Maintainers
+-----------
+
+- `@lukasa <https://github.com/lukasa>`_ (Cory Benfield)
+- `@sigmavirus24 <https://github.com/sigmavirus24>`_ (Ian Cordasco)
+- `@shazow <https://github.com/shazow>`_ (Andrey Petrov)
+
+👋
+
+Getting Started
+---------------
+
#. `Check for open issues <https://github.com/shazow/urllib3/issues>`_ or open
a fresh issue to start a discussion around a feature idea or a bug. There is
a *Contributor Friendly* tag for issues that should be ideal for people who
diff --git a/dev-requirements.txt b/dev-requirements.txt
index b371cd6..bc7cd7f 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -6,3 +6,4 @@ tox==2.1.1
twine==1.5.0
wheel==0.24.0
tornado==4.2.1
+PySocks==1.5.6
diff --git a/docs/contrib.rst b/docs/contrib.rst
index 5a88f8e..c85d3aa 100644
--- a/docs/contrib.rst
+++ b/docs/contrib.rst
@@ -4,7 +4,7 @@ Contrib Modules
===============
These modules implement various extra features, that may not be ready for
-prime time.
+prime time or that require optional third-party dependencies.
.. _contrib-pyopenssl:
@@ -16,7 +16,7 @@ SNI-support for Python 2
.. _gae:
-Google App Engine
+Google App Engine
-----------------
The :mod:`urllib3.contrib.appengine` module provides a pool manager that
@@ -45,8 +45,58 @@ There are `limitations <https://cloud.google.com/appengine/docs/python/urlfetch/
1. You can use :class:`AppEngineManager` with URLFetch. URLFetch is cost-effective in many circumstances as long as your usage is within the limitations.
2. You can use a normal :class:`PoolManager` by enabling sockets. Sockets also have `limitations and restrictions <https://cloud.google.com/appengine/docs/python/sockets/#limitations-and-restrictions>`_ and have a lower free quota than URLFetch. To use sockets, be sure to specify the following in your ``app.yaml``::
-
+
env_variables:
GAE_USE_SOCKETS_HTTPLIB : 'true'
3. If you are using `Managed VMs <https://cloud.google.com/appengine/docs/managed-vms/>`_, you can use the standard :class:`PoolManager` without any configuration or special environment variables.
+
+
+.. _socks:
+
+SOCKS Proxies
+-------------
+
+.. versionadded:: 1.14
+
+The :mod:`urllib3.contrib.socks` module enables urllib3 to work with proxies
+that use either the SOCKS4 or SOCKS5 protocols. These proxies are common in
+environments that want to allow generic TCP/UDP traffic through their borders,
+but don't want unrestricted traffic flows.
+
+To use it, either install ``PySocks`` or install urllib3 with the ``socks``
+extra, like so:
+
+.. code-block:: bash
+
+ $ pip install -U urllib3[socks]
+
+The SOCKS module provides a
+:class:`SOCKSProxyManager <urllib3.contrib.socks.SOCKSProxyManager>` that can
+be used when SOCKS support is required. This class behaves very much like a
+standard :class:`ProxyManager <urllib3.poolmanager.ProxyManager>`, but allows
+the use of a SOCKS proxy instead.
+
+Using it is simple. For example, with a SOCKS5 proxy running on the local
+machine, listening on port 8889:
+
+.. code-block:: python
+
+ from urllib3.contrib.socks import SOCKSProxyManager
+
+ http = SOCKSProxyManager('socks5://localhost:8889/')
+ r = http.request('GET', 'https://www.google.com/')
+
+The SOCKS implementation supports the full range of urllib3 features. It also
+supports the following SOCKS features:
+
+- SOCKS4
+- SOCKS4a
+- SOCKS5
+- Usernames and passwords for the SOCKS proxy
+
+The SOCKS module does have the following limitations:
+
+- No support for contacting a SOCKS proxy via IPv6.
+- No support for reaching websites via a literal IPv6 address: domain names
+ must be used.
diff --git a/docs/index.rst b/docs/index.rst
index 29e7ad7..c188202 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -12,6 +12,7 @@ urllib3 Documentation
exceptions
collections
contrib
+ recipes
Highlights
@@ -22,7 +23,7 @@ Highlights
:class:`~urllib3.connectionpool.HTTPConnectionPool` and
:class:`~urllib3.connectionpool.HTTPSConnectionPool`
-- File posting. See:
+- File posting with multipart encoding. See:
:func:`~urllib3.filepost.encode_multipart_formdata`
- Built-in redirection and retries (optional).
@@ -33,12 +34,14 @@ Highlights
- Thread-safe and sanity-safe.
+- Proxy over :ref:`HTTP or SOCKS <proxymanager>`.
+
- Tested on Python 2.6+ and Python 3.2+, 100% unit test coverage.
- Works with AppEngine, gevent, eventlib, and the standard library :mod:`io` module.
- Small and easy to understand codebase perfect for extending and building upon.
- For a more comprehensive solution, have a look at
+ For a simplified abstraction, have a look at
`Requests <http://python-requests.org/>`_ which is also powered by urllib3.
@@ -98,6 +101,18 @@ like buffering:
>>> secondpart = b.read()
+The response can be treated as a file-like object.
+A file can be downloaded directly to a local file in a context without
+being saved in memory.
+
+.. doctest ::
+
+ >>> url = 'http://example.com/file'
+ >>> http = urllib3.PoolManager()
+ >>> with http.request('GET', url, preload_content=False) as r, open('filename', 'wb') as fp:
+ >>> .... shutil.copyfileobj(r, fp)
+
+
Upgrading & Versioning
----------------------
@@ -153,13 +168,18 @@ A :class:`~urllib3.poolmanagers.PoolManager` is a proxy for a collection of
similar, so that instances of either can be passed around interchangeably.
+.. _proxymanager:
+
... 3289 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-urllib3.git
More information about the Python-modules-commits
mailing list