[Python-modules-commits] [python-httplib2] 02/10: Import python-httplib2_0.9.2+dfsg.orig.tar.gz

Scott Kitterman kitterman at moszumanska.debian.org
Wed Nov 9 21:34:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

kitterman pushed a commit to branch master
in repository python-httplib2.

commit 2638dd65066ee67711ab78dd29490b2277c7a08c
Author: Scott Kitterman <scott at kitterman.com>
Date:   Wed Nov 9 16:13:18 2016 -0500

    Import python-httplib2_0.9.2+dfsg.orig.tar.gz
---
 CHANGELOG                    |  8 ++++++++
 README.md                    | 26 +++++++++++++-------------
 doc/html/searchindex.json    |  1 -
 python2/httplib2/__init__.py |  7 ++++---
 python3/httplib2/__init__.py |  7 ++++---
 setup.py                     |  2 +-
 6 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 9e6688a..67f8421 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,11 @@
+0.9.2
+
+  Fixes in this release:
+
+   https://github.com/jcgregorio/httplib2/pull/313
+
+    Fix incorrect ResponseNotReady exceptions, retry on transient errors.
+
 0.9.1
 
   Fixes in this release:
diff --git a/README.md b/README.md
index 4731833..e164b7c 100644
--- a/README.md
+++ b/README.md
@@ -58,9 +58,9 @@ Usage
 A simple retrieval:
 
 ```python
-  import httplib2
-  h = httplib2.Http(".cache")
-  (resp_headers, content) = h.request("http://example.org/", "GET")
+import httplib2
+h = httplib2.Http(".cache")
+(resp_headers, content) = h.request("http://example.org/", "GET")
 ```
 
 The 'content' is the content retrieved from the URL. The content
@@ -69,22 +69,22 @@ is already decompressed or unzipped if necessary.
 To PUT some content to a server that uses SSL and Basic authentication:
 
 ```python
-  import httplib2
-  h = httplib2.Http(".cache")
-  h.add_credentials('name', 'password')
-  (resp, content) = h.request("https://example.org/chapter/2",
+import httplib2
+h = httplib2.Http(".cache")
+h.add_credentials('name', 'password')
+(resp, content) = h.request("https://example.org/chapter/2",
                             "PUT", body="This is text",
                             headers={'content-type':'text/plain'} )
-```                            
+```
 
 Use the Cache-Control: header to control how the caching operates.
 
 ```python
-  import httplib2
-  h = httplib2.Http(".cache")
-  (resp, content) = h.request("http://bitworking.org/", "GET")
-  ...
-  (resp, content) = h.request("http://bitworking.org/", "GET",
+import httplib2
+h = httplib2.Http(".cache")
+(resp, content) = h.request("http://bitworking.org/", "GET")
+...
+(resp, content) = h.request("http://bitworking.org/", "GET",
                             headers={'cache-control':'no-cache'})
 ```
 
diff --git a/doc/html/searchindex.json b/doc/html/searchindex.json
deleted file mode 100755
index 4342f48..0000000
--- a/doc/html/searchindex.json
+++ /dev/null
@@ -1 +0,0 @@
-[["index","libhttplib2"],["The httplib2 Library","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">httplib2</span></tt>  A comprehensive HTTP client library."],{"all":[1],"code":[1],"chain":[1],"suno":[1],"go":[1],"follow":[1],"privat":[1],"tt":[1],"readabl":[1],"to":[0,1],"those":[1],"sent":[1],"liter":[1],"everi":[1],"string":[1],"fals":[1],"unfamiliar":[1],"veri":[1],"affect":[1],"force_exception_to_status_cod":[1],"level":[1],"list":[1],"try":[1],"item":[1],"refer" [...]
\ No newline at end of file
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py
index 19e7cff..6fa3cc6 100644
--- a/python2/httplib2/__init__.py
+++ b/python2/httplib2/__init__.py
@@ -22,7 +22,7 @@ __contributors__ = ["Thomas Broyer (t.broyer at ltgt.net)",
                     "Sam Ruby",
                     "Louis Nyffenegger"]
 __license__ = "MIT"
-__version__ = "0.9.1"
+__version__ = "0.9.2"
 
 import re
 import sys
@@ -1285,8 +1285,9 @@ class Http(object):
                     err = getattr(e, 'args')[0]
                 else:
                     err = e.errno
-                if err == errno.ECONNREFUSED: # Connection refused
-                    raise
+                if err in (errno.ENETUNREACH, errno.EADDRNOTAVAIL) and i < RETRIES:
+                    continue  # retry on potentially transient socket errors
+                raise
             except httplib.HTTPException:
                 # Just because the server closed the connection doesn't apparently mean
                 # that the server didn't send a response.
diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py
index 260fa6b..3ce019e 100644
--- a/python3/httplib2/__init__.py
+++ b/python3/httplib2/__init__.py
@@ -24,7 +24,7 @@ __contributors__ = ["Thomas Broyer (t.broyer at ltgt.net)",
     "Louis Nyffenegger",
     "Mark Pilgrim"]
 __license__ = "MIT"
-__version__ = "0.9.1"
+__version__ = "0.9.2"
 
 import re
 import sys
@@ -994,8 +994,9 @@ class Http(object):
                 raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
             except socket.error as e:
                 errno_ = (e.args[0].errno if isinstance(e.args[0], socket.error) else e.errno)
-                if errno_ == errno.ECONNREFUSED: # Connection refused
-                    raise
+                if errno_ in (errno.ENETUNREACH, errno.EADDRNOTAVAIL) and i < RETRIES:
+                    continue  # retry on potentially transient errors
+                raise
             except http.client.HTTPException:
                 if conn.sock is None:
                     if i < RETRIES-1:
diff --git a/setup.py b/setup.py
index 4240f6c..fb00ed2 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ except ImportError:
 import sys
 
 pkgdir = {'': 'python%s' % sys.version_info[0]}
-VERSION = '0.9.1'
+VERSION = '0.9.2'
 
 setup(name='httplib2',
         version=VERSION,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-httplib2.git



More information about the Python-modules-commits mailing list