commit python-httplib2 for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community,
here is the log from the commit of package python-httplib2 for openSUSE:Factory checked in at 2013-02-25 20:40:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-httplib2 (Old)
and /work/SRC/openSUSE:Factory/.python-httplib2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-httplib2", Maintainer is "CStender@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-httplib2/python-httplib2.changes 2012-10-08 20:33:49.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-httplib2.new/python-httplib2.changes 2013-02-25 20:40:49.000000000 +0100
@@ -1,0 +2,23 @@
+Fri Jan 11 19:51:38 UTC 2013 - p.drouand@gmail.com
+
+- Drop unneeded python-pyOpenSSL Requires
+
+-------------------------------------------------------------------
+Fri Jan 11 19:39:31 UTC 2013 - p.drouand@gmail.com
+
+- Initial python3 support
+
+-------------------------------------------------------------------
+Fri Jan 11 19:38:07 UTC 2013 - p.drouand@gmail.com
+
+- Update to 0.7.7 version:
+ * More fixes for App Engine, now less likely to swallow important exceptions.
+ * Adding proxy_info_from_* methods to Python3. Reviewed in https://codereview.appspot.com/6588078/.
+ * Added GeoTrust cert
+ * Make httplib2.Http() instances pickleable. Reviewed in https://codereview.appspot.com/6506074/
+ * The following issues have been fixed:
+ - 229 python3 httplib2 clobbers multiple headers of same key
+ - 230 Expose meaningful exception for App Engine URLFetch ResponseTooLargeError
+ - 231 Expose App Engine URLFetch DeadlineExceededError for debugging purposes
+
+-------------------------------------------------------------------
New Changes file:
--- /dev/null 2013-02-25 16:34:27.356011506 +0100
+++ /work/SRC/openSUSE:Factory/.python-httplib2.new/python3-httplib2.changes 2013-02-25 20:40:50.000000000 +0100
@@ -0,0 +1,120 @@
+-------------------------------------------------------------------
+Fri Jan 11 19:51:38 UTC 2013 - p.drouand@gmail.com
+
+- Drop unneeded python-pyOpenSSL Requires
+
+-------------------------------------------------------------------
+Fri Jan 11 19:39:31 UTC 2013 - p.drouand@gmail.com
+
+- Initial python3 support
+
+-------------------------------------------------------------------
+Fri Jan 11 19:38:07 UTC 2013 - p.drouand@gmail.com
+
+- Update to 0.7.7 version:
+ * More fixes for App Engine, now less likely to swallow important exceptions.
+ * Adding proxy_info_from_* methods to Python3. Reviewed in https://codereview.appspot.com/6588078/.
+ * Added GeoTrust cert
+ * Make httplib2.Http() instances pickleable. Reviewed in https://codereview.appspot.com/6506074/
+ * The following issues have been fixed:
+ - 229 python3 httplib2 clobbers multiple headers of same key
+ - 230 Expose meaningful exception for App Engine URLFetch ResponseTooLargeError
+ - 231 Expose App Engine URLFetch DeadlineExceededError for debugging purposes
+
+-------------------------------------------------------------------
+Sat Oct 6 22:26:47 UTC 2012 - os-dev@jacraig.com
+
+- Update to 0.7.6:
+ * Fix app engine
+ * On Python App Engine 2.7 a body can be passed in that is actually a
+ stream. Do a full read of the contents of that stream before proceeding.
+- Update URL to one given in setup.py; also where the old one redirects to.
+
+-------------------------------------------------------------------
+Sun Sep 9 16:29:51 UTC 2012 - os-dev@jacraig.com
+
+- Update to 0.7.5, no changelog provided.
+
+-------------------------------------------------------------------
+Mon Jul 23 14:56:00 UTC 2012 - saschpe@suse.de
+
+- Require openssl-certs on SLE instead of ca-certificates
+
+-------------------------------------------------------------------
+Tue Jul 17 08:24:44 UTC 2012 - saschpe@suse.de
+
+- Add missing runtime requirement on python-pyOpenSSL to gain
+ access to 'ssl' module
+
+-------------------------------------------------------------------
+Mon Jul 9 08:47:20 UTC 2012 - cfarrell@suse.com
+
+- license update: MIT and Apache-2.0 and (MPL-1.1 or GPL-2.0+ or LGPL-2.1+)
+ __init__.py contains code derived from a Google owned Apache project.
+ cacerts.txt is Mozilla triple-licensed.
+
+-------------------------------------------------------------------
+Wed Jun 20 11:41:56 UTC 2012 - saschpe@suse.de
+
+- Don't ship private copy of Mozilla NSS certs, use system certs
+ instead (bnc#761162)
+
+-------------------------------------------------------------------
+Tue Jun 5 09:56:01 UTC 2012 - cstender@opensuse.org
+
+- update to version 0.7.4
+ * See CHANGELOG for all changes and fixes
+
+-------------------------------------------------------------------
+Thu Dec 22 12:52:35 UTC 2011 - cstender@suse.com
+
+- updated to version 0.7.2
+
+-------------------------------------------------------------------
+Mon Jul 11 14:06:42 CEST 2011 - cstender@suse.de
+
+- updated to version 0.7.1
+ * See CHANGELOG for all changes and fixes
+
+-------------------------------------------------------------------
+Mon Apr 19 13:47:15 CEST 2010 - dmueller@suse.de
+
+- update to version 0.6.0:
+ * include python 3 support/compatibility
+
+-------------------------------------------------------------------
+Thu Aug 13 10:55:40 UTC 2009 - cstender@novell.com
+
+- build as noarch
+
+-------------------------------------------------------------------
+Tue Aug 4 10:51:26 UTC 2009 - cstender@novell.com
+
+- updated to version 0.5.0
+ * Fixed the following bugs:
+ #12 - Cache-Control: only-if-cached incorrectly does request if
+ item not in cache
+ #39 - Deprecation warnings in Python 2.6
+ #54 - Http.request fails accesing Google account via http proxy
+ #56 - Block on response.read() for HEAD requests.
+ #57 - Timeout ignore for Python 2.6
+ #58 - Fixed parsing of Cache-Control: header to make it more
+ robust
+
+-------------------------------------------------------------------
+Tue Sep 9 12:41:28 CEST 2008 - cstender@suse.de
+
+- updated package to version 0.4.0
+ o added support for proxies if the Socksipy module is installed
+ o fixed bug with some HEAD responses having content-length set to
+ zero incorrectly
+ o fixed most except's to catch a specific exception
+ o added 'connection_type' parameter to Http.request()
+ o the default for 'force_exception_to_status_code' was changed to
+ False
+
+-------------------------------------------------------------------
+Sat Oct 21 22:37:29 CEST 2006 - dgollub@suse.de
+
+- initial version of python-httplib2 (0.2.0)
+
Old:
----
httplib2-0.7.6.tar.gz
New:
----
httplib2-0.7.7.tar.gz
pre_checkin.sh
python3-httplib2.changes
python3-httplib2.spec
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-httplib2.spec ++++++
--- /var/tmp/diff_new_pack.5Ly1JY/_old 2013-02-25 20:40:51.000000000 +0100
+++ /var/tmp/diff_new_pack.5Ly1JY/_new 2013-02-25 20:40:51.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-httplib2
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,26 +15,25 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+%define mod_name httplib2
Name: python-httplib2
-Version: 0.7.6
+Version: 0.7.7
Release: 0
Url: http://code.google.com/p/httplib2/
Summary: A Python HTTP client library
License: MIT and Apache-2.0 and (MPL-1.1 or GPL-2.0+ or LGPL-2.1+)
Group: Development/Libraries/Python
-Source0: httplib2-%{version}.tar.gz
+Source0: %{mod_name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE: Don't ship private copy of Mozilla NSS certs, use system certs instead (bnc#761162)
Patch0: httplib2-use-system-certs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
-#BuildRequires: python-pyOpenSSL
%if 0%{?sles_version}
Requires: openssl-certs
%else
Requires: ca-certificates
%endif
-Requires: python-pyOpenSSL
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
@@ -46,7 +45,7 @@
left out of other HTTP libraries.
%prep
-%setup -q -n httplib2-%{version}
+%setup -q -n %{mod_name}-%{version}
%patch0 -p1
%build
++++++ python3-httplib2.spec ++++++
#
# spec file for package python-httplib2
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define mod_name httplib2
Name: python3-httplib2
Version: 0.7.7
Release: 0
Url: http://code.google.com/p/httplib2/
Summary: A Python HTTP client library
License: MIT and Apache-2.0 and (MPL-1.1 or GPL-2.0+ or LGPL-2.1+)
Group: Development/Libraries/Python
Source0: %{mod_name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE: Don't ship private copy of Mozilla NSS certs, use system certs instead (bnc#761162)
Patch0: httplib2-use-system-certs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python3-devel
%if 0%{?sles_version}
Requires: openssl-certs
%else
Requires: ca-certificates
%endif
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python3_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
A comprehensive HTTP client library that supports many features
left out of other HTTP libraries.
%prep
%setup -q -n %{mod_name}-%{version}
%patch0 -p1
%build
python3 setup.py build
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
#%%check
#python python2/httplib2test.py
%files
%defattr(-,root,root)
%doc README
%{python3_sitelib}/*
%changelog
++++++ httplib2-0.7.6.tar.gz -> httplib2-0.7.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/CHANGELOG new/httplib2-0.7.7/CHANGELOG
--- old/httplib2-0.7.6/CHANGELOG 1970-01-01 01:00:00.000000000 +0100
+++ new/httplib2-0.7.7/CHANGELOG 2012-11-16 14:20:22.000000000 +0100
@@ -0,0 +1,199 @@
+0.7.7
+ More fixes for App Engine, now less likely to swallow important exceptions.
+ Adding proxy_info_from_* methods to Python3. Reviewed in https://codereview.appspot.com/6588078/.
+ Added GeoTrust cert
+ Make httplib2.Http() instances pickleable. Reviewed in https://codereview.appspot.com/6506074/
+
+ The following issues have been fixed:
+
+ 229 python3 httplib2 clobbers multiple headers of same key
+ 230 Expose meaningful exception for App Engine URLFetch ResponseTooLargeError
+ 231 Expose App Engine URLFetch DeadlineExceededError for debugging purposes
+
+0.7.6
+ Fixes for App Engine 2.7.
+
+0.7.5
+ Keys are lowercase in a Response object, regardless of how Response object is constructed.
+ Add control so that Authorization: headers aren't forwarded on a 3xx response by default.
+ Set the reason correctly when running on App Engine. Patch from Alain Vongsouvanh. Reviewed in http://codereview.appspot.com/6422051/
+ Fix proxy socks for SSL connections. Fixes issue #199.
+ You can now set httplib2.RETRIES to the number of retries before a request
+ is considered to fail It is set to a default of 2 to mimic the traditional
+ behavior of httplib2.
+
+ The following issues have been addressed:
+
+ 223 HEAD requests fail calling the close() method of ResponseDict instance.
+ 222 Can't disable cert validation in appengine
+ 204 Credentials can leak in HTTP redirects
+ 210 Different API between Python 2 and Python 3 version breaks wsgi_intercept
+ 214 ValueError on malformated cache entries
+ 204 Credentials can leak in HTTP redirects
+
+
+0.7.3
+ ProxyInfo objects now can construct themselves from environment
+ variables commonly-used in Unix environments. By default, the Http
+ class will construct a ProxyInfo instance based on these environment
+ variables. To achieve the previous behavior, where environment
+ variables are ignored, pass proxy_info=None to Http().
+
+ The following issues have been addressed:
+
+ Issue 159: automatic detection of proxy configuration.
+ Issue 179: Allow unicode in proxy hostname.
+ Issue 194: Added support for setuptools.
+ Fixes for HTTP CONNECT proxies.
+
+0.7.1
+ Fix failure to install cacerts.txt for 2.x installs.
+
+0.7.0
+ The two major changes in this release are SSL Certificate
+ checking and App Engine support. By default the certificates
+ of an HTTPS connection are checked, but that can be disabled
+ via disable_ssl_certificate_validation. The second change
+ is that on App Engine there is a new connection object
+ that utilizes the urlfetch capabilities on App Engine, including
+ setting timeouts and validating certificates.
+
+ The following issues have been addressed:
+
+ Fixes issue 72. Always lowercase authorization header.
+ Fix issue 47. Redirects that become a GET should not have a body.
+ Fixes issue 19. Set Content-location on redirected HEAD requests
+ Fixes issue 139. Redirect with a GET on 302 regardless of the originating method.
+ Fixes issue 138. Handle unicode in headers when writing and retrieving cache entries. Who says headers have to be ASCII!
+ Add certificate validation. Work initially started by Christoph Kern.
+ Set a version number. Fixes issue # 135.
+ Sync to latest version of socks.py
+ Add gzip to the user-agent, in case we are making a request to an app engine project: http://code.google.com/appengine/kb/general.html#compression
+ Uses a custom httplib shim on App Engine to wrap urlfetch, as opposed
+ Add default support for optimistic concurrency on PATCH requests
+ Fixes issue 126. IPv6 under various conditions would fail.
+ Fixes issue 131. Handle socket.timeout's that occur during send.
+ proxy support: degrade gracefully when socket.socket is unavailable
+
+
+0.6.0
+
+ The following issues have been addressed:
+
+ #51 - Failure to handle server legitimately closing connection before request body is fully sent
+ #77 - Duplicated caching test
+ #65 - Transform _normalize_headers into a method of Http class
+ #45 - Vary header
+ #73 - All files in Mercurial are executable
+ #81 - Have a useful .hgignore
+ #78 - Add release tags to the Mercurial repository
+ #67 - HEAD requests cause next request to be retried
+
+ Mostly bug fixes, the big enhancement is the addition of proper Vary: header
+ handling. Thanks to Chris Dent for that change.
+
+ The other big change is the build process for distributions so that both python2 and python3
+ are included in the same .tar.gz/.zip file.
+
+0.5.0
+
+ Added Python 3 support
+
+ Fixed the following bugs:
+
+ #12 - Cache-Control: only-if-cached incorrectly does request if item not in cache
+ #39 - Deprecation warnings in Python 2.6
+ #54 - Http.request fails accesing Google account via http proxy
+ #56 - Block on response.read() for HEAD requests.
+ #57 - Timeout ignore for Python 2.6
+ #58 - Fixed parsing of Cache-Control: header to make it more robust
+
+ Also fixed a deprecation warning that appeared between Python 3.0 and 3.1.
+
+0.4.0
+
+ Added support for proxies if the Socksipy module is installed.
+
+ Fixed bug with some HEAD responses having content-length set to
+ zero incorrectly.
+
+ Fixed most except's to catch a specific exception.
+
+ Added 'connection_type' parameter to Http.request().
+
+ The default for 'force_exception_to_status_code' was changed to False. Defaulting
+ to True was causing quite a bit of confusion.
+
+
+0.3.0
+ Calling Http.request() with a relative URI, as opposed to an absolute URI,
+ will now throw a specific exception.
+
+ Http() now has an additional optional parameter for the socket timeout.
+
+ Exceptions can now be forced into responses. That is, instead of
+ throwing an exception, a good httlib2.Response object is returned
+ that describe the error with an appropriate status code.
+
+ Many improvements to the file cache:
+
+ 1. The names in the cache are now much less
+ opaque, which should help with debugging.
+
+ 2. The disk cache is now Apache mod_asis compatible.
+
+ 3. A Content-Location: header is supplied and stored in the
+ cache which points to the original requested URI.
+
+ User supplied If-* headers now override httplib2 supplied
+ versions.
+
+ IRIs are now fully supported. Note that they MUST be passed in
+ as unicode objects.
+
+ Http.add_credentials() now takes an optional domain to restrict
+ the credentials to being only used on that domain.
+
+ Added Http.add_certificate() which allows setting
+ a key and cert for SSL connnections.
+
+ Many other bugs fixed.
+
+
+0.2.0
+ Added support for Google Auth.
+
+ Added experimental support for HMACDigest.
+
+ Added support for a pluggable caching system. Now supports
+ the old system of using the file system and now memcached.
+
+ Added httplib2.debuglevel which turns on debugging.
+
+ Change Response._previous to Response.previous.
+
+ Addded Http.follow_all_redirects which forces
+ httplib2 to follow all redirects, as opposed to
+ following only the safe redirects. This makes the
+ GData protocol easier to use.
+
+ All known bugs fixed to date.
+
+0.1.1
+
+ Fixed several bugs raised by James Antill:
+ 1. HEAD didn't get an Accept: header added like GET.
+ 2. HEAD requests did not use the cache.
+ 3. GET requests with Range: headers would erroneously return a full cached response.
+ 4. Subsequent requests to resources that had timed out would raise an exception.
+ And one feature request for 'method' to default to GET.
+
+ Xavier Verges Farrero supplied what I needed to make the
+ library work with Python 2.3.
+
+ I added distutils based setup.py.
+
+0.1 Rev 86
+
+ Initial Release
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/MANIFEST.in new/httplib2-0.7.7/MANIFEST.in
--- old/httplib2-0.7.6/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100
+++ new/httplib2-0.7.7/MANIFEST.in 2012-11-16 14:20:22.000000000 +0100
@@ -0,0 +1,3 @@
+recursive-include python2 *.py *.txt
+recursive-include python3 *.py *.txt
+include python2/httplib2/test/*.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/PKG-INFO new/httplib2-0.7.7/PKG-INFO
--- old/httplib2-0.7.6/PKG-INFO 2012-09-11 19:22:03.000000000 +0200
+++ new/httplib2-0.7.7/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,64 +0,0 @@
-Metadata-Version: 1.1
-Name: httplib2
-Version: 0.7.6
-Summary: A comprehensive HTTP client library.
-Home-page: http://code.google.com/p/httplib2/
-Author: Joe Gregorio
-Author-email: joe@bitworking.org
-License: MIT
-Download-URL: http://httplib2.googlecode.com/files/httplib2-0.7.6.tar.gz
-Description:
-
- A comprehensive HTTP client library, ``httplib2`` supports many features left out of other HTTP libraries.
-
- **HTTP and HTTPS**
- HTTPS support is only available if the socket module was compiled with SSL support.
-
-
- **Keep-Alive**
- Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible.
-
-
- **Authentication**
- The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS.
-
- * Digest
- * Basic
- * WSSE
-
- **Caching**
- The module can optionally operate with a private cache that understands the Cache-Control:
- header and uses both the ETag and Last-Modified cache validators. Both file system
- and memcached based caches are supported.
-
-
- **All Methods**
- The module can handle any HTTP request method, not just GET and POST.
-
-
- **Redirects**
- Automatically follows 3XX redirects on GETs.
-
-
- **Compression**
- Handles both 'deflate' and 'gzip' types of compression.
-
-
- **Lost update support**
- Automatically adds back ETags into PUT requests to resources we have already cached. This implements Section 3.2 of Detecting the Lost Update Problem Using Unreserved Checkout
-
-
- **Unit Tested**
- A large and growing set of unit tests.
-
-
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Environment :: Web Environment
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3
-Classifier: Topic :: Internet :: WWW/HTTP
-Classifier: Topic :: Software Development :: Libraries
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python2/httplib2/__init__.py new/httplib2-0.7.7/python2/httplib2/__init__.py
--- old/httplib2-0.7.6/python2/httplib2/__init__.py 2012-09-11 19:22:02.000000000 +0200
+++ new/httplib2-0.7.7/python2/httplib2/__init__.py 2012-11-16 14:20:22.000000000 +0100
@@ -22,7 +22,7 @@
"Sam Ruby",
"Louis Nyffenegger"]
__license__ = "MIT"
-__version__ = "0.7.6"
+__version__ = "0.7.7"
import re
import sys
@@ -763,67 +763,6 @@
def isgood(self):
return (self.proxy_host != None) and (self.proxy_port != None)
- @classmethod
- def from_environment(cls, method='http'):
- """
- Read proxy info from the environment variables.
- """
- if method not in ['http', 'https']:
- return
-
- env_var = method + '_proxy'
- url = os.environ.get(env_var, os.environ.get(env_var.upper()))
- if not url:
- return
- pi = cls.from_url(url, method)
-
- no_proxy = os.environ.get('no_proxy', os.environ.get('NO_PROXY', ''))
- bypass_hosts = []
- if no_proxy:
- bypass_hosts = no_proxy.split(',')
- # special case, no_proxy=* means all hosts bypassed
- if no_proxy == '*':
- bypass_hosts = AllHosts
-
- pi.bypass_hosts = bypass_hosts
- return pi
-
- @classmethod
- def from_url(cls, url, method='http'):
- """
- Construct a ProxyInfo from a URL (such as http_proxy env var)
- """
- url = urlparse.urlparse(url)
- username = None
- password = None
- port = None
- if '@' in url[1]:
- ident, host_port = url[1].split('@', 1)
- if ':' in ident:
- username, password = ident.split(':', 1)
- else:
- password = ident
- else:
- host_port = url[1]
- if ':' in host_port:
- host, port = host_port.split(':', 1)
- else:
- host = host_port
-
- if port:
- port = int(port)
- else:
- port = dict(https=443, http=80)[method]
-
- proxy_type = 3 # socks.PROXY_TYPE_HTTP
- return cls(
- proxy_type = proxy_type,
- proxy_host = host,
- proxy_port = port,
- proxy_user = username or None,
- proxy_pass = password or None,
- )
-
def applies_to(self, hostname):
return not self.bypass_host(hostname)
@@ -840,6 +779,66 @@
return bypass
+def proxy_info_from_environment(method='http'):
+ """
+ Read proxy info from the environment variables.
+ """
+ if method not in ['http', 'https']:
+ return
+
+ env_var = method + '_proxy'
+ url = os.environ.get(env_var, os.environ.get(env_var.upper()))
+ if not url:
+ return
+ pi = proxy_info_from_url(url, method)
+
+ no_proxy = os.environ.get('no_proxy', os.environ.get('NO_PROXY', ''))
+ bypass_hosts = []
+ if no_proxy:
+ bypass_hosts = no_proxy.split(',')
+ # special case, no_proxy=* means all hosts bypassed
+ if no_proxy == '*':
+ bypass_hosts = AllHosts
+
+ pi.bypass_hosts = bypass_hosts
+ return pi
+
+def proxy_info_from_url(url, method='http'):
+ """
+ Construct a ProxyInfo from a URL (such as http_proxy env var)
+ """
+ url = urlparse.urlparse(url)
+ username = None
+ password = None
+ port = None
+ if '@' in url[1]:
+ ident, host_port = url[1].split('@', 1)
+ if ':' in ident:
+ username, password = ident.split(':', 1)
+ else:
+ password = ident
+ else:
+ host_port = url[1]
+ if ':' in host_port:
+ host, port = host_port.split(':', 1)
+ else:
+ host = host_port
+
+ if port:
+ port = int(port)
+ else:
+ port = dict(https=443, http=80)[method]
+
+ proxy_type = 3 # socks.PROXY_TYPE_HTTP
+ return ProxyInfo(
+ proxy_type = proxy_type,
+ proxy_host = host,
+ proxy_port = port,
+ proxy_user = username or None,
+ proxy_pass = password or None,
+ )
+
+
class HTTPConnectionWithTimeout(httplib.HTTPConnection):
"""
HTTPConnection subclass that supports timeouts
@@ -1064,16 +1063,15 @@
raise ImportError # Bail out; we're not actually running on App Engine.
from google.appengine.api.urlfetch import fetch
from google.appengine.api.urlfetch import InvalidURLError
- from google.appengine.api.urlfetch import DownloadError
- from google.appengine.api.urlfetch import ResponseTooLargeError
- from google.appengine.api.urlfetch import SSLCertificateError
-
class ResponseDict(dict):
- """Is a dictionary that also has a read() method, so
- that it can pass itself off as an httlib.HTTPResponse()."""
+ """Dictionary with a read() method; can pass off as httplib.HTTPResponse."""
+ def __init__(self, *args, **kwargs):
+ self.content = kwargs.pop('content', None)
+ return super(ResponseDict, self).__init__(*args, **kwargs)
+
def read(self):
- pass
+ return self.content
class AppEngineHttpConnection(object):
@@ -1110,17 +1108,14 @@
headers=headers, allow_truncated=False, follow_redirects=False,
deadline=self.timeout,
validate_certificate=self.validate_certificate)
- self.response = ResponseDict(response.headers)
+ self.response = ResponseDict(response.headers, content=response.content)
self.response['status'] = str(response.status_code)
self.response['reason'] = httplib.responses.get(response.status_code, 'Ok')
self.response.status = response.status_code
- setattr(self.response, 'read', lambda : response.content)
# Make sure the exceptions raised match the exceptions expected.
except InvalidURLError:
raise socket.gaierror('')
- except (DownloadError, ResponseTooLargeError, SSLCertificateError):
- raise httplib.HTTPException()
def getresponse(self):
if self.response:
@@ -1171,7 +1166,7 @@
and more.
"""
def __init__(self, cache=None, timeout=None,
- proxy_info=ProxyInfo.from_environment,
+ proxy_info=proxy_info_from_environment,
ca_certs=None, disable_ssl_certificate_validation=False):
"""If 'cache' is a string then it is used as a directory name for
a disk cache. Otherwise it must be an object that supports the
@@ -1185,7 +1180,7 @@
`proxy_info` may be:
- a callable that takes the http scheme ('http' or 'https') and
returns a ProxyInfo instance per request. By default, uses
- ProxyInfo.from_environment.
+ proxy_nfo_from_environment.
- a ProxyInfo instance (static proxy config).
- None (proxy disabled).
@@ -1239,6 +1234,20 @@
# Keep Authorization: headers on a redirect.
self.forward_authorization_headers = False
+ def __getstate__(self):
+ state_dict = copy.copy(self.__dict__)
+ # In case request is augmented by some foreign object such as
+ # credentials which handle auth
+ if 'request' in state_dict:
+ del state_dict['request']
+ if 'connections' in state_dict:
+ del state_dict['connections']
+ return state_dict
+
+ def __setstate__(self, state):
+ self.__dict__.update(state)
+ self.connections = {}
+
def _auth_from_challenge(self, host, request_uri, headers, response, content):
"""A generator that creates Authorization objects
that can be applied to requests.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python2/httplib2/__init__.py.rej new/httplib2-0.7.7/python2/httplib2/__init__.py.rej
--- old/httplib2-0.7.6/python2/httplib2/__init__.py.rej 1970-01-01 01:00:00.000000000 +0100
+++ new/httplib2-0.7.7/python2/httplib2/__init__.py.rej 2012-11-16 14:20:22.000000000 +0100
@@ -0,0 +1,21 @@
+--- __init__.py
++++ __init__.py
+@@ -828,7 +828,7 @@
+
+ and more.
+ """
+- def __init__(self, cache=None, timeout=None, proxy_info=None):
++ def __init__(self, cache=None, timeout=None, proxy_info=None, tries=2):
+ """
+ The value of proxy_info is a ProxyInfo instance.
+
+@@ -840,6 +840,9 @@
+ then Python's default timeout for sockets will be used. See
+ for example the docs of socket.setdefaulttimeout():
+ http://docs.python.org/library/socket.html#socket.setdefaulttimeout
++
++ A request will be tried `tries` times if it fails.
++
+ """
+ self.proxy_info = proxy_info
+ # Map domain name to an httplib connection
Files old/httplib2-0.7.6/python2/httplib2/__init__.pyc-2.4 and new/httplib2-0.7.7/python2/httplib2/__init__.pyc-2.4 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python2/httplib2/cacerts.txt new/httplib2-0.7.7/python2/httplib2/cacerts.txt
--- old/httplib2-0.7.6/python2/httplib2/cacerts.txt 2012-09-11 19:22:02.000000000 +0200
+++ new/httplib2-0.7.7/python2/httplib2/cacerts.txt 2012-11-16 14:20:22.000000000 +0100
@@ -712,3 +712,28 @@
W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd
-----END CERTIFICATE-----
+GeoTrust Global CA
+==================
+
+-----BEGIN CERTIFICATE-----
+MIIDfTCCAuagAwIBAgIDErvmMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT
+MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0
+aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDIwNTIxMDQwMDAwWhcNMTgwODIxMDQwMDAw
+WjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UE
+AxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9m
+OSm9BXiLnTjoBbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIu
+T8rxh0PBFpVXLVDviS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6c
+JmTM386DGXHKTubU1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmR
+Cw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5asz
+PeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo4HwMIHtMB8GA1UdIwQYMBaAFEjm
+aPkr0rKV10fYIyAQTzOYkJ/UMB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrM
+TjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjA6BgNVHR8EMzAxMC+g
+LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDBO
+BgNVHSAERzBFMEMGBFUdIAAwOzA5BggrBgEFBQcCARYtaHR0cHM6Ly93d3cuZ2Vv
+dHJ1c3QuY29tL3Jlc291cmNlcy9yZXBvc2l0b3J5MA0GCSqGSIb3DQEBBQUAA4GB
+AHbhEm5OSxYShjAGsoEIz/AIx8dxfmbuwu3UOx//8PDITtZDOLC5MH0Y0FWDomrL
+NhGc6Ehmo21/uBPUR/6LWlxz/K7ZGzIZOKuXNBSqltLroxwUCEm2u+WR74M26x1W
+b8ravHNjkOR/ez4iyz0H7V84dJzjA1BOoa+Y7mHyhD8S
+-----END CERTIFICATE-----
+
Files old/httplib2-0.7.6/python2/httplib2/iri2uri.pyc-2.4 and new/httplib2-0.7.7/python2/httplib2/iri2uri.pyc-2.4 differ
Files old/httplib2-0.7.6/python2/httplib2/socks.pyc-2.4 and new/httplib2-0.7.7/python2/httplib2/socks.pyc-2.4 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python2/httplib2.egg-info/SOURCES.txt new/httplib2-0.7.7/python2/httplib2.egg-info/SOURCES.txt
--- old/httplib2-0.7.6/python2/httplib2.egg-info/SOURCES.txt 2012-09-11 19:22:02.000000000 +0200
+++ new/httplib2-0.7.7/python2/httplib2.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100
@@ -1,22 +0,0 @@
-MANIFEST.in
-README
-setup.py
-python2/httplib2test.py
-python2/httplib2test_appengine.py
-python2/httplib2/__init__.py
-python2/httplib2/iri2uri.py
-python2/httplib2/socks.py
-python2/httplib2.egg-info/PKG-INFO
-python2/httplib2.egg-info/SOURCES.txt
-python2/httplib2.egg-info/dependency_links.txt
-python2/httplib2.egg-info/top_level.txt
-python2/httplib2/test/__init__.py
-python2/httplib2/test/miniserver.py
-python2/httplib2/test/other_cacerts.txt
-python2/httplib2/test/smoke_test.py
-python2/httplib2/test/test_no_socket.py
-python2/httplib2/test/brokensocket/socket.py
-python2/httplib2/test/functional/test_proxies.py
-python3/httplib2test.py
-python3/httplib2/__init__.py
-python3/httplib2/iri2uri.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python2/httplib2.egg-info/dependency_links.txt new/httplib2-0.7.7/python2/httplib2.egg-info/dependency_links.txt
--- old/httplib2-0.7.6/python2/httplib2.egg-info/dependency_links.txt 2012-09-11 19:22:02.000000000 +0200
+++ new/httplib2-0.7.7/python2/httplib2.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python2/httplib2.egg-info/top_level.txt new/httplib2-0.7.7/python2/httplib2.egg-info/top_level.txt
--- old/httplib2-0.7.6/python2/httplib2.egg-info/top_level.txt 2012-09-11 19:22:02.000000000 +0200
+++ new/httplib2-0.7.7/python2/httplib2.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-httplib2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python2/httplib2test.py new/httplib2-0.7.7/python2/httplib2test.py
--- old/httplib2-0.7.6/python2/httplib2test.py 2012-09-11 19:22:02.000000000 +0200
+++ new/httplib2-0.7.7/python2/httplib2test.py 2012-11-16 14:20:22.000000000 +0100
@@ -20,6 +20,7 @@
import httplib
import httplib2
import os
+import pickle
import socket
import sys
import time
@@ -722,21 +723,22 @@
self.assertEqual(response.fromcache, False, msg="Should not be from cache")
def testNoVary(self):
+ pass
# when there is no vary, a different Accept header (e.g.) should not
# impact if the cache is used
# test that the vary header is not sent
- uri = urlparse.urljoin(base, "vary/no-vary.asis")
- (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
- self.assertEqual(response.status, 200)
- self.assertFalse(response.has_key('vary'))
-
- (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
- self.assertEqual(response.status, 200)
- self.assertEqual(response.fromcache, True, msg="Should be from cache")
-
- (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/html'})
- self.assertEqual(response.status, 200)
- self.assertEqual(response.fromcache, True, msg="Should be from cache")
+ # uri = urlparse.urljoin(base, "vary/no-vary.asis")
+ # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
+ # self.assertEqual(response.status, 200)
+ # self.assertFalse(response.has_key('vary'))
+
+ # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
+ # self.assertEqual(response.status, 200)
+ # self.assertEqual(response.fromcache, True, msg="Should be from cache")
+ #
+ # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/html'})
+ # self.assertEqual(response.status, 200)
+ # self.assertEqual(response.fromcache, True, msg="Should be from cache")
def testVaryHeaderDouble(self):
uri = urlparse.urljoin(base, "vary/accept-double.asis")
@@ -1182,6 +1184,40 @@
for c in self.http.connections.values():
self.assertEqual(None, c.sock)
+ def testPickleHttp(self):
+ pickled_http = pickle.dumps(self.http)
+ new_http = pickle.loads(pickled_http)
+
+ self.assertEqual(sorted(new_http.__dict__.keys()),
+ sorted(self.http.__dict__.keys()))
+ for key in new_http.__dict__:
+ if key in ('certificates', 'credentials'):
+ self.assertEqual(new_http.__dict__[key].credentials,
+ self.http.__dict__[key].credentials)
+ elif key == 'cache':
+ self.assertEqual(new_http.__dict__[key].cache,
+ self.http.__dict__[key].cache)
+ else:
+ self.assertEqual(new_http.__dict__[key],
+ self.http.__dict__[key])
+
+ def testPickleHttpWithConnection(self):
+ self.http.request('http://bitworking.org',
+ connection_type=_MyHTTPConnection)
+ pickled_http = pickle.dumps(self.http)
+ new_http = pickle.loads(pickled_http)
+
+ self.assertEqual(self.http.connections.keys(), ['http:bitworking.org'])
+ self.assertEqual(new_http.connections, {})
+
+ def testPickleCustomRequestHttp(self):
+ def dummy_request(*args, **kwargs):
+ return new_request(*args, **kwargs)
+ dummy_request.dummy_attr = 'dummy_value'
+
+ self.http.request = dummy_request
+ pickled_http = pickle.dumps(self.http)
+ self.assertFalse("S'request'" in pickled_http)
try:
import memcache
@@ -1584,13 +1620,13 @@
os.environ.update(self.orig_env)
def test_from_url(self):
- pi = httplib2.ProxyInfo.from_url('http://myproxy.example.com')
+ pi = httplib2.proxy_info_from_url('http://myproxy.example.com')
self.assertEquals(pi.proxy_host, 'myproxy.example.com')
self.assertEquals(pi.proxy_port, 80)
self.assertEquals(pi.proxy_user, None)
def test_from_url_ident(self):
- pi = httplib2.ProxyInfo.from_url('http://zoidberg:fish@someproxy:99')
+ pi = httplib2.proxy_info_from_url('http://zoidberg:fish@someproxy:99')
self.assertEquals(pi.proxy_host, 'someproxy')
self.assertEquals(pi.proxy_port, 99)
self.assertEquals(pi.proxy_user, 'zoidberg')
@@ -1598,7 +1634,7 @@
def test_from_env(self):
os.environ['http_proxy'] = 'http://myproxy.example.com:8080'
- pi = httplib2.ProxyInfo.from_environment()
+ pi = httplib2.proxy_info_from_environment()
self.assertEquals(pi.proxy_host, 'myproxy.example.com')
self.assertEquals(pi.proxy_port, 8080)
self.assertEquals(pi.bypass_hosts, [])
@@ -1607,7 +1643,7 @@
os.environ['http_proxy'] = 'http://myproxy.example.com:80'
os.environ['https_proxy'] = 'http://myproxy.example.com:81'
os.environ['no_proxy'] = 'localhost,otherhost.domain.local'
- pi = httplib2.ProxyInfo.from_environment('https')
+ pi = httplib2.proxy_info_from_environment('https')
self.assertEquals(pi.proxy_host, 'myproxy.example.com')
self.assertEquals(pi.proxy_port, 81)
self.assertEquals(pi.bypass_hosts, ['localhost',
@@ -1615,14 +1651,14 @@
def test_from_env_none(self):
os.environ.clear()
- pi = httplib2.ProxyInfo.from_environment()
+ pi = httplib2.proxy_info_from_environment()
self.assertEquals(pi, None)
def test_applies_to(self):
os.environ['http_proxy'] = 'http://myproxy.example.com:80'
os.environ['https_proxy'] = 'http://myproxy.example.com:81'
os.environ['no_proxy'] = 'localhost,otherhost.domain.local,example.com'
- pi = httplib2.ProxyInfo.from_environment()
+ pi = httplib2.proxy_info_from_environment()
self.assertFalse(pi.applies_to('localhost'))
self.assertTrue(pi.applies_to('www.google.com'))
self.assertFalse(pi.applies_to('www.example.com'))
@@ -1630,7 +1666,7 @@
def test_no_proxy_star(self):
os.environ['http_proxy'] = 'http://myproxy.example.com:80'
os.environ['NO_PROXY'] = '*'
- pi = httplib2.ProxyInfo.from_environment()
+ pi = httplib2.proxy_info_from_environment()
for host in ('localhost', '169.254.38.192', 'www.google.com'):
self.assertFalse(pi.applies_to(host))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httplib2-0.7.6/python3/README new/httplib2-0.7.7/python3/README
--- old/httplib2-0.7.6/python3/README 1970-01-01 01:00:00.000000000 +0100
+++ new/httplib2-0.7.7/python3/README 2012-11-16 14:20:22.000000000 +0100
@@ -0,0 +1,68 @@
+httplib2 for Python 3
+
+This directory contains a port of httplib2 to Python 3. As you may
+know, Python 3 is not backward-compatible with Python 2. The biggest
+change in Python 3 (that affects httplib2) is the distinction between
+bytes and strings.
+
+To successfully use http2lib for Python 3, you absolutely must
+understand the following sentence:
+
+** THE RESPONSE HEADERS ARE STRINGS, BUT THE CONTENT BODY IS BYTES **
+
+
+Example:
+
+>>> import httplib2, pprint
+>>> h = httplib2.Http(".cache")
+>>> (resp_headers, content) = h.request("http://example.org/", "GET")
+>>> pprint.pprint(resp_headers)
+{'accept-ranges': 'bytes',
+ 'connection': 'close',
+ 'content-length': '438',
+ 'content-location': 'http://example.org/',
+ 'content-type': 'text/html; charset=UTF-8',
+ 'date': 'Fri, 29 May 2009 03:57:29 GMT',
+ 'etag': '"b80f4-1b6-80bfd280"',
+ 'last-modified': 'Tue, 15 Nov 2005 13:24:10 GMT',
+ 'server': 'Apache/2.2.3 (CentOS)',
+ 'status': '200'}
+>>> type(content)
+
participants (1)
-
root@hilbert.suse.de