Hello community,

here is the log from the commit of package python3-CherryPy for 
openSUSE:Factory checked in at 2016-03-16 10:35:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-CherryPy (Old)
 and      /work/SRC/openSUSE:Factory/.python3-CherryPy.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-CherryPy"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-CherryPy/python3-CherryPy.changes        
2016-02-16 09:19:20.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-CherryPy.new/python3-CherryPy.changes   
2016-03-16 10:36:00.000000000 +0100
@@ -1,0 +2,20 @@
+Sat Mar 12 19:21:01 UTC 2016 - a...@gmx.de
+
+- update to version 5.1.0:
+  * Bugfix issue #1315 for "test_HTTP11_pipelining" test in Python 3.5
+  * Bugfix issue #1382 regarding the keyword arguments support for
+    Python 3 on the config file.
+  * Bugfix issue #1406 for "test_2_KeyboardInterrupt" test in Python
+    3.5.  by monkey patching the HTTPRequest given a bug on CPython
+    that is affecting the testsuite
+    (https://bugs.python.org/issue23377).
+  * Add additional parameter "raise_subcls" to the tests helpers
+    `openURL` and "CPWebCase.getPage" to have finer control on which
+    exceptions can be raised.
+  * Add support for direct keywords on the calls (e.g. "foo=bar") on
+    the config file under Python 3.
+  * Add additional validation to determine if the process is running
+    as a daemon on "cherrypy.process.plugins.SignalHandler" to allow
+    the execution of the testsuite under CI tools.
+
+-------------------------------------------------------------------

Old:
----
  CherryPy-5.0.1.tar.gz

New:
----
  CherryPy-5.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-CherryPy.spec ++++++
--- /var/tmp/diff_new_pack.npw24G/_old  2016-03-16 10:36:01.000000000 +0100
+++ /var/tmp/diff_new_pack.npw24G/_new  2016-03-16 10:36:01.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           python3-CherryPy
-Version:        5.0.1
+Version:        5.1.0
 Release:        0
 Url:            http://www.cherrypy.org
 Summary:        Object-Oriented HTTP framework

++++++ CherryPy-5.0.1.tar.gz -> CherryPy-5.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/CherryPy.egg-info/PKG-INFO 
new/CherryPy-5.1.0/CherryPy.egg-info/PKG-INFO
--- old/CherryPy-5.0.1/CherryPy.egg-info/PKG-INFO       2016-02-06 
02:09:05.000000000 +0100
+++ new/CherryPy-5.1.0/CherryPy.egg-info/PKG-INFO       2016-03-10 
15:15:36.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: CherryPy
-Version: 5.0.1
+Version: 5.1.0
 Summary: Object-Oriented HTTP framework
 Home-page: http://www.cherrypy.org
 Author: CherryPy Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/PKG-INFO new/CherryPy-5.1.0/PKG-INFO
--- old/CherryPy-5.0.1/PKG-INFO 2016-02-06 02:09:06.000000000 +0100
+++ new/CherryPy-5.1.0/PKG-INFO 2016-03-10 15:15:37.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: CherryPy
-Version: 5.0.1
+Version: 5.1.0
 Summary: Object-Oriented HTTP framework
 Home-page: http://www.cherrypy.org
 Author: CherryPy Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/__init__.py 
new/CherryPy-5.1.0/cherrypy/__init__.py
--- old/CherryPy-5.0.1/cherrypy/__init__.py     2016-02-04 14:40:55.000000000 
+0100
+++ new/CherryPy-5.1.0/cherrypy/__init__.py     2016-03-10 15:15:31.000000000 
+0100
@@ -56,7 +56,7 @@
 These API's are described in the `CherryPy specification 
<https://bitbucket.org/cherrypy/cherrypy/wiki/CherryPySpec>`_.
 """
 
-__version__ = "5.0.1"
+__version__ = "5.1.0"
 
 from cherrypy._cpcompat import urljoin as _urljoin, urlencode as _urlencode
 from cherrypy._cpcompat import basestring, unicodestr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/lib/reprconf.py 
new/CherryPy-5.1.0/cherrypy/lib/reprconf.py
--- old/CherryPy-5.0.1/cherrypy/lib/reprconf.py 2014-06-27 22:32:38.000000000 
+0200
+++ new/CherryPy-5.1.0/cherrypy/lib/reprconf.py 2016-03-10 15:02:16.000000000 
+0100
@@ -281,13 +281,14 @@
             # Everything else becomes args
             else :
                 args.append(self.build(child))
+
         return callee(*args, **kwargs)
 
     def build_Keyword(self, o):
         key, value_obj = o.getChildren()
         value = self.build(value_obj)
         kw_dict = {key: value}
-        return kw_dict 
+        return kw_dict
 
     def build_List(self, o):
         return map(self.build, o.getChildren())
@@ -377,7 +378,39 @@
     def build_Index(self, o):
         return self.build(o.value)
 
+    def _build_call35(self, o):
+        """
+        Workaround for python 3.5 _ast.Call signature, docs found here
+        https://greentreesnakes.readthedocs.org/en/latest/nodes.html
+        """
+        import ast
+        callee = self.build(o.func)
+        args = []
+        if o.args is not None:
+            for a in o.args:
+                if isinstance(a, ast.Starred):
+                    args.append(self.build(a.value))
+                else:
+                    args.append(self.build(a))
+        kwargs = {}
+        for kw in o.keywords:
+            if kw.arg is None: # double asterix `**`
+                rst = self.build(kw.value)
+                if not isinstance(rst, dict):
+                    raise TypeError("Invalid argument for call."
+                                    "Must be a mapping object.")
+                # give preference to the keys set directly from arg=value
+                for k, v in rst.items():
+                    if k not in kwargs:
+                        kwargs[k] = v
+            else: # defined on the call as: arg=value
+                kwargs[kw.arg] = self.build(kw.value)
+        return callee(*args, **kwargs)
+
     def build_Call(self, o):
+        if sys.version_info >= (3, 5):
+            return self._build_call35(o)
+
         callee = self.build(o.func)
 
         if o.args is None:
@@ -388,13 +421,16 @@
         if o.starargs is None:
             starargs = ()
         else:
-            starargs = self.build(o.starargs)
+            starargs = tuple(self.build(o.starargs))
 
         if o.kwargs is None:
             kwargs = {}
         else:
             kwargs = self.build(o.kwargs)
-
+        if o.keywords is not None: # direct a=b keywords
+            for kw in o.keywords:
+                # preference because is a direct keyword against **kwargs
+                kwargs[kw.arg] = self.build(kw.value)
         return callee(*(args + starargs), **kwargs)
 
     def build_List(self, o):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/process/plugins.py 
new/CherryPy-5.1.0/cherrypy/process/plugins.py
--- old/CherryPy-5.0.1/cherrypy/process/plugins.py      2016-02-04 
14:15:56.000000000 +0100
+++ new/CherryPy-5.1.0/cherrypy/process/plugins.py      2016-03-10 
15:02:16.000000000 +0100
@@ -109,12 +109,35 @@
             self.handlers['SIGINT'] = self._jython_SIGINT_handler
 
         self._previous_handlers = {}
+        # used to determine is the process is a daemon in `self._is_daemonized`
+        self._original_pid = os.getpid()
+
 
     def _jython_SIGINT_handler(self, signum=None, frame=None):
         # See http://bugs.jython.org/issue1313
         self.bus.log('Keyboard Interrupt: shutting down bus')
         self.bus.exit()
 
+    def _is_daemonized(self):
+        """Return boolean indicating if the current process is
+        running as a daemon.
+
+        The criteria to determine the `daemon` condition is to verify
+        if the current pid is not the same as the one that got used on
+        the initial construction of the plugin *and* the stdin is not
+        connected to a terminal.
+
+        The sole validation of the tty is not enough when the plugin
+        is executing inside other process like in a CI tool
+        (Buildbot, Jenkins).
+        """
+        if (self._original_pid != os.getpid() and
+            not os.isatty(sys.stdin.fileno())):
+            return True
+        else:
+            return False
+
+
     def subscribe(self):
         """Subscribe self.handlers to signals."""
         for sig, func in self.handlers.items():
@@ -180,13 +203,13 @@
 
     def handle_SIGHUP(self):
         """Restart if daemonized, else exit."""
-        if os.isatty(sys.stdin.fileno()):
+        if self._is_daemonized():
+            self.bus.log("SIGHUP caught while daemonized. Restarting.")
+            self.bus.restart()
+        else:
             # not daemonized (may be foreground or background)
             self.bus.log("SIGHUP caught but not daemonized. Exiting.")
             self.bus.exit()
-        else:
-            self.bus.log("SIGHUP caught while daemonized. Restarting.")
-            self.bus.restart()
 
 
 try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/test/helper.py 
new/CherryPy-5.1.0/cherrypy/test/helper.py
--- old/CherryPy-5.0.1/cherrypy/test/helper.py  2016-02-04 14:15:56.000000000 
+0100
+++ new/CherryPy-5.1.0/cherrypy/test/helper.py  2016-03-10 15:02:16.000000000 
+0100
@@ -341,12 +341,18 @@
         sys.exit()
 
     def getPage(self, url, headers=None, method="GET", body=None,
-                protocol=None):
-        """Open the url. Return status, headers, body."""
+                protocol=None, raise_subcls=None):
+        """Open the url. Return status, headers, body.
+
+        `raise_subcls` must be a tuple with the exceptions classes
+        or a single exception class that are not going to be considered
+        a socket.error regardless that they were are subclass of a
+        socket.error and therefore not considered for a connection retry.
+        """
         if self.script_name:
             url = httputil.urljoin(self.script_name, url)
         return webtest.WebCase.getPage(self, url, headers, method, body,
-                                       protocol)
+                                       protocol, raise_subcls)
 
     def skip(self, msg='skipped '):
         raise nose.SkipTest(msg)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/test/test_config.py 
new/CherryPy-5.1.0/cherrypy/test/test_config.py
--- old/CherryPy-5.0.1/cherrypy/test/test_config.py     2014-06-27 
22:32:38.000000000 +0200
+++ new/CherryPy-5.1.0/cherrypy/test/test_config.py     2016-03-10 
15:02:16.000000000 +0100
@@ -269,3 +269,37 @@
         self.assertEqual(cherrypy.config["my"]["my.dir"], "/some/dir/my/dir")
         self.assertEqual(cherrypy.config["my"]
                          ["my.dir2"], "/some/dir/my/dir/dir2")
+
+
+class CallablesInConfigTest(unittest.TestCase):
+    setup_server = staticmethod(setup_server)
+
+
+    def test_call_with_literal_dict(self):
+        from textwrap import dedent
+        conf = dedent("""
+        [my]
+        value = dict(**{'foo': 'bar'})
+        """)
+        fp = compat.StringIO(conf)
+        cherrypy.config.update(fp)
+        self.assertEqual(cherrypy.config['my']['value'], {'foo': 'bar'})
+
+    def test_call_with_kwargs(self):
+        from textwrap import dedent
+        conf = dedent("""
+        [my]
+        value = dict(foo="buzz", **cherrypy._test_dict)
+        """)
+        test_dict = {
+            "foo": "bar",
+            "bar": "foo",
+            "fizz": "buzz"
+        }
+        cherrypy._test_dict = test_dict
+        fp = compat.StringIO(conf)
+        cherrypy.config.update(fp)
+        test_dict['foo'] = 'buzz'
+        self.assertEqual(cherrypy.config['my']['value']['foo'], 'buzz')
+        self.assertEqual(cherrypy.config['my']['value'], test_dict)
+        del cherrypy._test_dict
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/test/test_conn.py 
new/CherryPy-5.1.0/cherrypy/test/test_conn.py
--- old/CherryPy-5.0.1/cherrypy/test/test_conn.py       2016-02-04 
14:15:56.000000000 +0100
+++ new/CherryPy-5.1.0/cherrypy/test/test_conn.py       2016-03-10 
15:02:16.000000000 +0100
@@ -3,16 +3,23 @@
 import socket
 import sys
 import time
-timeout = 1
+import errno
 
 
 import cherrypy
 from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, NotConnected
-from cherrypy._cpcompat import BadStatusLine, ntob, tonative, urlopen, 
unicodestr
+from cherrypy._cpcompat import (
+    BadStatusLine,
+    ntob,
+    tonative,
+    urlopen,
+    unicodestr,
+    py3k
+)
 from cherrypy.test import webtest
-from cherrypy import _cperror
 
 
+timeout = 1
 pov = 'pPeErRsSiIsStTeEnNcCeE oOfF vViIsSiIoOnN'
 
 
@@ -434,6 +441,12 @@
 
             # Retrieve previous response
             response = conn.response_class(conn.sock, method="GET")
+            # there is a bug in python3 regarding the buffering of
+            # ``conn.sock``. Until that bug get's fixed we will
+            # monkey patch the ``reponse`` instance.
+            # https://bugs.python.org/issue23377
+            if py3k:
+                response.fp = conn.sock.makefile("rb", 0)
             response.begin()
             body = response.read(13)
             self.assertEqual(response.status, 200)
@@ -751,24 +764,31 @@
         'server.accepted_queue_timeout': 0.1,
     })
 
-import errno
-socket_reset_errors = []
-# Not all of these names will be defined for every platform.
-for _ in ("ECONNRESET", "WSAECONNRESET"):
-    if _ in dir(errno):
-        socket_reset_errors.append(getattr(errno, _))
+reset_names = 'ECONNRESET', 'WSAECONNRESET'
+socket_reset_errors = [
+    getattr(errno, name)
+    for name in reset_names
+    if hasattr(errno, name)
+]
+"reset error numbers available on this platform"
+
+socket_reset_errors += [
+    # Python 3.5 raises an http.client.RemoteDisconnected
+    # with this message
+    "Remote end closed connection without response",
+]
+
 
 class LimitedRequestQueueTests(helper.CPWebCase):
-    setup_server = staticmethod(setup_upload_server)    
+    setup_server = staticmethod(setup_upload_server)
 
     def test_queue_full(self):
         conns = []
         overflow_conn = None
-        
+
         try:
             # Make 15 initial requests and leave them open, which should use
             # all of wsgiserver's WorkerThreads and fill its Queue.
-            import time
             for i in range(15):
                 conn = self.HTTP_CONN(self.HOST, self.PORT)
                 conn.putrequest("POST", "/upload", skip_host=True)
@@ -777,7 +797,7 @@
                 conn.putheader("Content-Length", "4")
                 conn.endheaders()
                 conns.append(conn)
-            
+
             # Now try a 16th conn, which should be closed by the server 
immediately.
             overflow_conn = self.HTTP_CONN(self.HOST, self.PORT)
             # Manually connect since httplib won't let us set a timeout
@@ -788,7 +808,7 @@
                 overflow_conn.sock.settimeout(5)
                 overflow_conn.sock.connect(sa)
                 break
-            
+
             overflow_conn.putrequest("GET", "/", skip_host=True)
             overflow_conn.putheader("Host", self.HOST)
             overflow_conn.endheaders()
@@ -799,8 +819,11 @@
                 if exc.args[0] in socket_reset_errors:
                     pass # Expected.
                 else:
-                    raise AssertionError("Overflow conn did not get RST. "
-                                         "Got %s instead" % repr(exc.args))
+                    tmpl = (
+                        "Overflow conn did not get RST. "
+                        "Got {exc.args!r} instead"
+                    )
+                    raise AssertionError(tmpl.format(**locals()))
             except BadStatusLine:
                 # This is a special case in OS X. Linux and Windows will
                 # RST correctly.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/test/test_core.py 
new/CherryPy-5.1.0/cherrypy/test/test_core.py
--- old/CherryPy-5.0.1/cherrypy/test/test_core.py       2016-02-04 
14:30:16.000000000 +0100
+++ new/CherryPy-5.1.0/cherrypy/test/test_core.py       2016-02-06 
13:37:35.000000000 +0100
@@ -9,6 +9,7 @@
 from cherrypy._cpcompat import IncompleteRead, itervalues, ntob
 from cherrypy import _cptools, tools
 from cherrypy.lib import httputil, static
+from cherrypy.test._test_decorators import ExposeExamples
 
 
 favicon_path = os.path.join(os.getcwd(), localDir, "../favicon.ico")
@@ -41,10 +42,7 @@
             baseurl.exposed = True
 
         root = Root()
-
-        if sys.version_info >= (2, 5):
-            from cherrypy.test._test_decorators import ExposeExamples
-            root.expose_dec = ExposeExamples()
+        root.expose_dec = ExposeExamples()
 
         class TestType(type):
 
@@ -250,11 +248,7 @@
                 cherrypy.response.cookie[str(name)] = cookie.value
 
             def multiple(self, names):
-                for name in names:
-                    cookie = cherrypy.request.cookie[name]
-                    # Python2's SimpleCookie.__setitem__ won't take unicode
-                    # keys.
-                    cherrypy.response.cookie[str(name)] = cookie.value
+                list(map(self.single, names))
 
         def append_headers(header_list, debug=False):
             if debug:
@@ -554,7 +548,22 @@
         self.getPage("/favicon.ico")
         self.assertBody(data)
 
+    def skip_if_bad_cookies(self):
+        """
+        cookies module fails to reject invalid cookies
+        https://bitbucket.org/cherrypy/cherrypy/issues/1405
+        """
+        cookies = sys.modules.get('http.cookies')
+        _is_legal_key = getattr(cookies, '_is_legal_key', lambda x: False)
+        if not _is_legal_key(','):
+            return
+        issue = 'http://bugs.python.org/issue26302'
+        tmpl = "Broken cookies module ({issue})"
+        self.skip(tmpl.format(**locals()))
+
     def testCookies(self):
+        self.skip_if_bad_cookies()
+
         self.getPage("/cookies/single?name=First",
                      [('Cookie', 'First=Dinsdale;')])
         self.assertHeader('Set-Cookie', 'First=Dinsdale')
@@ -655,9 +664,6 @@
         self.assertBody('/page1')
 
     def test_expose_decorator(self):
-        if not sys.version_info >= (2, 5):
-            return self.skip("skipped (Python 2.5+ only) ")
-
         # Test @expose
         self.getPage("/expose_dec/no_call")
         self.assertStatus(200)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/test/test_states.py 
new/CherryPy-5.1.0/cherrypy/test/test_states.py
--- old/CherryPy-5.0.1/cherrypy/test/test_states.py     2014-06-27 
22:32:38.000000000 +0200
+++ new/CherryPy-5.1.0/cherrypy/test/test_states.py     2016-03-10 
15:02:16.000000000 +0100
@@ -204,9 +204,25 @@
         # thread will just die without writing a response.
         engine.start()
         cherrypy.server.start()
-
+        # From python3.5 a new exception is retuned when the connection
+        # ends abruptly:
+        #   http.client.RemoteDisconnected
+        # RemoteDisconnected is a subclass of:
+        #   (ConnectionResetError, http.client.BadStatusLine)
+        # and ConnectionResetError is an indirect subclass of:
+        #    OSError
+        # From python 3.3 an up socket.error is an alias to OSError
+        # following PEP-3151, therefore http.client.RemoteDisconnected
+        # is considered a socket.error.
+        #
+        # raise_subcls specifies the classes that are not going
+        # to be considered as a socket.error for the retries.
+        # Given that RemoteDisconnected is part BadStatusLine
+        # we can use the same call for all py3 versions without
+        # sideffects. python < 3.5 will raise directly BadStatusLine
+        # which is not a subclass for socket.error/OSError.
         try:
-            self.getPage("/ctrlc")
+            self.getPage("/ctrlc", raise_subcls=BadStatusLine)
         except BadStatusLine:
             pass
         else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/CherryPy-5.0.1/cherrypy/test/test_wsgi_unix_socket.py 
new/CherryPy-5.1.0/cherrypy/test/test_wsgi_unix_socket.py
--- old/CherryPy-5.0.1/cherrypy/test/test_wsgi_unix_socket.py   2016-02-04 
14:15:56.000000000 +0100
+++ new/CherryPy-5.1.0/cherrypy/test/test_wsgi_unix_socket.py   2016-02-08 
04:00:22.000000000 +0100
@@ -2,6 +2,7 @@
 import sys
 import socket
 import atexit
+import tempfile
 
 import cherrypy
 from cherrypy.test import helper
@@ -9,7 +10,7 @@
 
 
 USOCKET_PATH = os.path.join(
-    os.path.dirname(os.path.realpath(__file__)),
+    tempfile.gettempdir(),
     'cp_test.sock'
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/test/webtest.py 
new/CherryPy-5.1.0/cherrypy/test/webtest.py
--- old/CherryPy-5.0.1/cherrypy/test/webtest.py 2014-06-27 22:32:38.000000000 
+0200
+++ new/CherryPy-5.1.0/cherrypy/test/webtest.py 2016-03-10 15:02:16.000000000 
+0100
@@ -238,8 +238,13 @@
         return interface(self.HOST)
 
     def getPage(self, url, headers=None, method="GET", body=None,
-                protocol=None):
+                protocol=None, raise_subcls=None):
         """Open the url with debugging support. Return status, headers, body.
+
+        `raise_subcls` must be a tuple with the exceptions classes
+        or a single exception class that are not going to be considered
+        a socket.error regardless that they were are subclass of a
+        socket.error and therefore not considered for a connection retry.
         """
         ServerError.on = False
 
@@ -252,7 +257,8 @@
         self.time = None
         start = time.time()
         result = openURL(url, headers, method, body, self.HOST, self.PORT,
-                         self.HTTP_CONN, protocol or self.PROTOCOL)
+                         self.HTTP_CONN, protocol or self.PROTOCOL,
+                         raise_subcls)
         self.time = time.time() - start
         self.status, self.headers, self.body = result
 
@@ -492,9 +498,15 @@
 
 def openURL(url, headers=None, method="GET", body=None,
             host="127.0.0.1", port=8000, http_conn=HTTPConnection,
-            protocol="HTTP/1.1"):
-    """Open the given HTTP resource and return status, headers, and body."""
-
+            protocol="HTTP/1.1", raise_subcls=None):
+    """
+    Open the given HTTP resource and return status, headers, and body.
+
+    `raise_subcls` must be a tuple with the exceptions classes
+    or a single exception class that are not going to be considered
+    a socket.error regardless that they were are subclass of a
+    socket.error and therefore not considered for a connection retry.
+    """
     headers = cleanHeaders(headers, method, body, host, port)
 
     # Trying 10 times is simply in case of socket errors.
@@ -510,48 +522,10 @@
             conn._http_vsn_str = protocol
             conn._http_vsn = int("".join([x for x in protocol if x.isdigit()]))
 
-            # skip_accept_encoding argument added in python version 2.4
-            if sys.version_info < (2, 4):
-                def putheader(self, header, value):
-                    if header == 'Accept-Encoding' and value == 'identity':
-                        return
-                    self.__class__.putheader(self, header, value)
-                import new
-                conn.putheader = new.instancemethod(
-                    putheader, conn, conn.__class__)
-                conn.putrequest(method.upper(), url, skip_host=True)
-            elif not py3k:
-                conn.putrequest(method.upper(), url, skip_host=True,
-                                skip_accept_encoding=True)
-            else:
-                import http.client
-                # Replace the stdlib method, which only accepts ASCII url's
-
-                def putrequest(self, method, url):
-                    if (
-                        self._HTTPConnection__response and
-                        self._HTTPConnection__response.isclosed()
-                    ):
-                        self._HTTPConnection__response = None
-
-                    if self._HTTPConnection__state == http.client._CS_IDLE:
-                        self._HTTPConnection__state = (
-                            http.client._CS_REQ_STARTED)
-                    else:
-                        raise http.client.CannotSendRequest()
-
-                    self._method = method
-                    if not url:
-                        url = ntob('/')
-                    request = ntob(' ').join(
-                        (method.encode("ASCII"),
-                         url,
-                         self._http_vsn_str.encode("ASCII")))
-                    self._output(request)
-                import types
-                conn.putrequest = types.MethodType(putrequest, conn)
-
-                conn.putrequest(method.upper(), url)
+            if py3k and isinstance(url, bytes):
+                url = url.decode()
+            conn.putrequest(method.upper(), url, skip_host=True,
+                            skip_accept_encoding=True)
 
             for key, value in headers:
                 conn.putheader(key, value.encode("Latin-1"))
@@ -570,10 +544,15 @@
                 conn.close()
 
             return s, h, b
-        except socket.error:
-            time.sleep(0.5)
-            if trial == 9:
+        except socket.error as e:
+            if raise_subcls is not None and isinstance(e, raise_subcls):
                 raise
+            else:
+                time.sleep(0.5)
+                if trial == 9:
+                    raise
+
+
 
 
 # Add any exceptions which your web framework handles
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/wsgiserver/wsgiserver2.py 
new/CherryPy-5.1.0/cherrypy/wsgiserver/wsgiserver2.py
--- old/CherryPy-5.0.1/cherrypy/wsgiserver/wsgiserver2.py       2016-02-04 
14:40:55.000000000 +0100
+++ new/CherryPy-5.1.0/cherrypy/wsgiserver/wsgiserver2.py       2016-03-10 
15:15:31.000000000 +0100
@@ -1756,7 +1756,7 @@
     timeout = 10
     """The timeout in seconds for accepted connections (default 10)."""
 
-    version = "CherryPy/5.0.1"
+    version = "CherryPy/5.1.0"
     """A version string for the HTTPServer."""
 
     software = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/cherrypy/wsgiserver/wsgiserver3.py 
new/CherryPy-5.1.0/cherrypy/wsgiserver/wsgiserver3.py
--- old/CherryPy-5.0.1/cherrypy/wsgiserver/wsgiserver3.py       2016-02-04 
14:40:55.000000000 +0100
+++ new/CherryPy-5.1.0/cherrypy/wsgiserver/wsgiserver3.py       2016-03-10 
15:15:31.000000000 +0100
@@ -1478,7 +1478,7 @@
     timeout = 10
     """The timeout in seconds for accepted connections (default 10)."""
 
-    version = "CherryPy/5.0.1"
+    version = "CherryPy/5.1.0"
     """A version string for the HTTPServer."""
 
     software = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CherryPy-5.0.1/setup.py new/CherryPy-5.1.0/setup.py
--- old/CherryPy-5.0.1/setup.py 2016-02-04 14:40:55.000000000 +0100
+++ new/CherryPy-5.1.0/setup.py 2016-03-10 15:15:31.000000000 +0100
@@ -36,7 +36,7 @@
 # arguments for the setup command
 ###############################################################################
 name = "CherryPy"
-version = "5.0.1"
+version = "5.1.0"
 desc = "Object-Oriented HTTP framework"
 long_desc = "CherryPy is a pythonic, object-oriented HTTP framework"
 classifiers = [


Reply via email to