Hello community, here is the log from the commit of package python3-CherryPy for openSUSE:Factory checked in at 2016-08-03 11:44:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-07-27 16:13:09.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-CherryPy.new/python3-CherryPy.changes 2016-08-03 11:45:14.000000000 +0200 @@ -1,0 +2,11 @@ +Fri Jul 29 06:08:18 UTC 2016 - arun@gmx.de + +- update to version 7.1.0: + * # 1458: Implement systemd's socket activation mechanism for + CherryPy servers, based on work sponsored by Endless Computers. + + Socket Activation allows one to setup a system so that systemd + will sit on a port and start services 'on demand' (a little bit + like inetd and xinetd used to do). + +------------------------------------------------------------------- Old: ---- CherryPy-7.0.0.tar.gz New: ---- CherryPy-7.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-CherryPy.spec ++++++ --- /var/tmp/diff_new_pack.xzz8NQ/_old 2016-08-03 11:45:15.000000000 +0200 +++ /var/tmp/diff_new_pack.xzz8NQ/_new 2016-08-03 11:45:15.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-CherryPy -Version: 7.0.0 +Version: 7.1.0 Release: 0 Url: http://www.cherrypy.org Summary: Object-Oriented HTTP framework ++++++ CherryPy-7.0.0.tar.gz -> CherryPy-7.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/CherryPy.egg-info/PKG-INFO new/CherryPy-7.1.0/CherryPy.egg-info/PKG-INFO --- old/CherryPy-7.0.0/CherryPy.egg-info/PKG-INFO 2016-07-24 18:16:11.000000000 +0200 +++ new/CherryPy-7.1.0/CherryPy.egg-info/PKG-INFO 2016-07-25 22:37:11.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: CherryPy -Version: 7.0.0 +Version: 7.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-7.0.0/CherryPy.egg-info/SOURCES.txt new/CherryPy-7.1.0/CherryPy.egg-info/SOURCES.txt --- old/CherryPy-7.0.0/CherryPy.egg-info/SOURCES.txt 2016-07-24 18:16:11.000000000 +0200 +++ new/CherryPy-7.1.0/CherryPy.egg-info/SOURCES.txt 2016-07-25 22:37:11.000000000 +0200 @@ -118,6 +118,7 @@ cherrypy/test/static/dirback.jpg cherrypy/test/static/has space.html cherrypy/test/static/index.html +cherrypy/test/static/Слава Україні.html cherrypy/tutorial/README.txt cherrypy/tutorial/__init__.py cherrypy/tutorial/custom_error.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/PKG-INFO new/CherryPy-7.1.0/PKG-INFO --- old/CherryPy-7.0.0/PKG-INFO 2016-07-24 18:16:11.000000000 +0200 +++ new/CherryPy-7.1.0/PKG-INFO 2016-07-25 22:37:11.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: CherryPy -Version: 7.0.0 +Version: 7.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-7.0.0/cherrypy/_cpcompat.py new/CherryPy-7.1.0/cherrypy/_cpcompat.py --- old/CherryPy-7.0.0/cherrypy/_cpcompat.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_cpcompat.py 2016-07-25 22:35:49.000000000 +0200 @@ -1,6 +1,6 @@ """Compatibility code for using CherryPy with various versions of Python. -CherryPy 3.2 is compatible with Python versions 2.3+. This module provides a +CherryPy 3.2 is compatible with Python versions 2.6+. This module provides a useful abstraction over the differences between Python versions, sometimes by preferring a newer idiom, sometimes an older one, and sometimes a custom one. @@ -23,8 +23,6 @@ import six if six.PY3: - basestring = (bytes, str) - def ntob(n, encoding='ISO-8859-1'): """Return the given native string as a byte string in the given encoding. @@ -49,8 +47,6 @@ return n else: # Python 2 - basestring = basestring - def ntob(n, encoding='ISO-8859-1'): """Return the given native string as a byte string in the given encoding. @@ -238,14 +234,6 @@ t.setDaemon(val) try: - from email.utils import formatdate - - def HTTPDate(timeval=None): - return formatdate(timeval, usegmt=True) -except ImportError: - from rfc822 import formatdate as HTTPDate - -try: # Python 3 from urllib.parse import unquote as parse_unquote @@ -291,6 +279,7 @@ else: json_encode = _json_encode +text_or_bytes = six.text_type, six.binary_type try: import cPickle as pickle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/_cpconfig.py new/CherryPy-7.1.0/cherrypy/_cpconfig.py --- old/CherryPy-7.0.0/cherrypy/_cpconfig.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_cpconfig.py 2016-07-25 22:35:49.000000000 +0200 @@ -119,7 +119,7 @@ """ import cherrypy -from cherrypy._cpcompat import basestring +from cherrypy._cpcompat import text_or_bytes from cherrypy.lib import reprconf # Deprecated in CherryPy 3.2--remove in 3.3 @@ -132,7 +132,7 @@ If the given config is a filename, it will be appended to the list of files to monitor for "autoreload" changes. """ - if isinstance(other, basestring): + if isinstance(other, text_or_bytes): cherrypy.engine.autoreload.files.add(other) # Load other into base @@ -152,7 +152,7 @@ def update(self, config): """Update self from a dict, file or filename.""" - if isinstance(config, basestring): + if isinstance(config, text_or_bytes): # Filename cherrypy.engine.autoreload.files.add(config) reprconf.Config.update(self, config) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/_cperror.py new/CherryPy-7.1.0/cherrypy/_cperror.py --- old/CherryPy-7.0.0/cherrypy/_cperror.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_cperror.py 2016-07-25 22:35:49.000000000 +0200 @@ -121,7 +121,7 @@ import six -from cherrypy._cpcompat import basestring, iteritems, ntob +from cherrypy._cpcompat import text_or_bytes, iteritems, ntob from cherrypy._cpcompat import tonative, urljoin as _urljoin from cherrypy.lib import httputil as _httputil @@ -209,7 +209,7 @@ import cherrypy request = cherrypy.serving.request - if isinstance(urls, basestring): + if isinstance(urls, text_or_bytes): urls = [urls] abs_urls = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/_cpmodpy.py new/CherryPy-7.1.0/cherrypy/_cpmodpy.py --- old/CherryPy-7.0.0/cherrypy/_cpmodpy.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_cpmodpy.py 2016-07-25 22:35:49.000000000 +0200 @@ -262,7 +262,7 @@ req.flush() # Set response body - if isinstance(body, basestring): + if isinstance(body, text_or_bytes): req.write(body) else: for seg in body: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/_cpreqbody.py new/CherryPy-7.1.0/cherrypy/_cpreqbody.py --- old/CherryPy-7.0.0/cherrypy/_cpreqbody.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_cpreqbody.py 2016-07-25 22:35:49.000000000 +0200 @@ -132,7 +132,7 @@ return ntob('').join(atoms) import cherrypy -from cherrypy._cpcompat import basestring, ntob, ntou +from cherrypy._cpcompat import text_or_bytes, ntob, ntou from cherrypy.lib import httputil @@ -715,7 +715,7 @@ self.file = self.read_into_file() else: result = self.read_lines_to_boundary() - if isinstance(result, basestring): + if isinstance(result, text_or_bytes): self.value = result else: self.file = result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/_cprequest.py new/CherryPy-7.1.0/cherrypy/_cprequest.py --- old/CherryPy-7.0.0/cherrypy/_cprequest.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_cprequest.py 2016-07-25 22:35:49.000000000 +0200 @@ -5,7 +5,7 @@ import six import cherrypy -from cherrypy._cpcompat import basestring, copykeys, ntob +from cherrypy._cpcompat import text_or_bytes, copykeys, ntob from cherrypy._cpcompat import SimpleCookie, CookieError from cherrypy import _cpreqbody, _cpconfig from cherrypy._cperror import format_exc, bare_error @@ -139,7 +139,7 @@ # hookpoint per path (e.g. "hooks.before_handler.1"). # Little-known fact you only get from reading source ;) hookpoint = k.split(".", 1)[0] - if isinstance(v, basestring): + if isinstance(v, text_or_bytes): v = cherrypy.lib.attributes(v) if not isinstance(v, Hook): v = Hook(v) @@ -815,7 +815,7 @@ if six.PY3 and isinstance(value, str): raise ValueError(self.unicode_err) - if isinstance(value, basestring): + if isinstance(value, text_or_bytes): # strings get wrapped in a list because iterating over a single # item list is much faster than iterating over every character # in a long string. @@ -901,7 +901,7 @@ def collapse_body(self): """Collapse self.body to a single string; replace it and return it.""" - if isinstance(self.body, basestring): + if isinstance(self.body, text_or_bytes): return self.body newbody = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/_cpserver.py new/CherryPy-7.1.0/cherrypy/_cpserver.py --- old/CherryPy-7.0.0/cherrypy/_cpserver.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_cpserver.py 2016-07-25 22:35:49.000000000 +0200 @@ -4,7 +4,7 @@ import cherrypy from cherrypy.lib import attributes -from cherrypy._cpcompat import basestring +from cherrypy._cpcompat import text_or_bytes # We import * because we want to export check_port # et al as attributes of this module. @@ -156,7 +156,7 @@ if httpserver is None: from cherrypy import _cpwsgi_server httpserver = _cpwsgi_server.CPWSGIServer(self) - if isinstance(httpserver, basestring): + if isinstance(httpserver, text_or_bytes): # Is anyone using this? Can I add an arg? httpserver = attributes(httpserver)(self) return httpserver, self.bind_addr @@ -180,7 +180,7 @@ self.socket_file = None self.socket_host = None self.socket_port = None - elif isinstance(value, basestring): + elif isinstance(value, text_or_bytes): self.socket_file = value self.socket_host = None self.socket_port = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/_helper.py new/CherryPy-7.1.0/cherrypy/_helper.py --- old/CherryPy-7.0.0/cherrypy/_helper.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/_helper.py 2016-07-25 22:35:49.000000000 +0200 @@ -5,7 +5,7 @@ import six from cherrypy._cpcompat import urljoin as _urljoin, urlencode as _urlencode -from cherrypy._cpcompat import basestring +from cherrypy._cpcompat import text_or_bytes import cherrypy @@ -17,7 +17,7 @@ def expose_(func): func.exposed = True if alias is not None: - if isinstance(alias, basestring): + if isinstance(alias, text_or_bytes): parents[alias.replace(".", "_")] = func else: for a in alias: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/lib/cptools.py new/CherryPy-7.1.0/cherrypy/lib/cptools.py --- old/CherryPy-7.0.0/cherrypy/lib/cptools.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/lib/cptools.py 2016-07-25 22:35:49.000000000 +0200 @@ -7,7 +7,7 @@ import six import cherrypy -from cherrypy._cpcompat import basestring +from cherrypy._cpcompat import text_or_bytes from cherrypy.lib import httputil as _httputil from cherrypy.lib import is_iterator @@ -533,7 +533,7 @@ """ if not media: return - if isinstance(media, basestring): + if isinstance(media, text_or_bytes): media = [media] request = cherrypy.serving.request diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/lib/encoding.py new/CherryPy-7.1.0/cherrypy/lib/encoding.py --- old/CherryPy-7.0.0/cherrypy/lib/encoding.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/lib/encoding.py 2016-07-25 22:35:49.000000000 +0200 @@ -5,7 +5,7 @@ import six import cherrypy -from cherrypy._cpcompat import basestring, ntob +from cherrypy._cpcompat import text_or_bytes, ntob from cherrypy.lib import file_generator from cherrypy.lib import is_closable_iterator from cherrypy.lib import set_vary_header @@ -219,7 +219,7 @@ response = cherrypy.serving.response self.body = self.oldhandler(*args, **kwargs) - if isinstance(self.body, basestring): + if isinstance(self.body, text_or_bytes): # strings get wrapped in a list because iterating over a single # item list is much faster than iterating over every character # in a long string. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/lib/httputil.py new/CherryPy-7.1.0/cherrypy/lib/httputil.py --- old/CherryPy-7.0.0/cherrypy/lib/httputil.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/lib/httputil.py 2016-07-25 22:35:49.000000000 +0200 @@ -7,12 +7,14 @@ to a public caning. """ +import functools +import email.utils from binascii import b2a_base64 import six -from cherrypy._cpcompat import BaseHTTPRequestHandler, HTTPDate, ntob, ntou -from cherrypy._cpcompat import basestring, iteritems +from cherrypy._cpcompat import BaseHTTPRequestHandler, ntob, ntou +from cherrypy._cpcompat import text_or_bytes, iteritems from cherrypy._cpcompat import reversed, sorted, unquote_qs response_codes = BaseHTTPRequestHandler.responses.copy() @@ -29,6 +31,9 @@ from cgi import parse_header +HTTPDate = functools.partial(email.utils.formatdate, usegmt=True) + + def urljoin(*atoms): """Return the given path \*atoms, joined into a single URL. @@ -460,7 +465,7 @@ if isinstance(k, six.text_type): k = cls.encode(k) - if not isinstance(v, basestring): + if not isinstance(v, text_or_bytes): v = str(v) if isinstance(v, six.text_type): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/lib/jsontools.py new/CherryPy-7.1.0/cherrypy/lib/jsontools.py --- old/CherryPy-7.0.0/cherrypy/lib/jsontools.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/lib/jsontools.py 2016-07-25 22:35:49.000000000 +0200 @@ -1,5 +1,5 @@ import cherrypy -from cherrypy._cpcompat import basestring, ntou, json_encode, json_decode +from cherrypy._cpcompat import text_or_bytes, ntou, json_encode, json_decode def json_processor(entity): @@ -41,7 +41,7 @@ package importable; otherwise, ValueError is raised during processing. """ request = cherrypy.serving.request - if isinstance(content_type, basestring): + if isinstance(content_type, text_or_bytes): content_type = [content_type] if force: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/lib/reprconf.py new/CherryPy-7.1.0/cherrypy/lib/reprconf.py --- old/CherryPy-7.0.0/cherrypy/lib/reprconf.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/lib/reprconf.py 2016-07-25 22:35:49.000000000 +0200 @@ -30,9 +30,9 @@ from sets import Set as set try: - basestring + text_or_bytes except NameError: - basestring = str + text_or_bytes = str try: # Python 3 @@ -47,7 +47,7 @@ def as_dict(config): """Return a dict from 'config' whether it is a dict, file, or filename.""" - if isinstance(config, basestring): + if isinstance(config, text_or_bytes): config = Parser().dict_from_file(config) elif hasattr(config, 'read'): config = Parser().dict_from_file(config) @@ -155,7 +155,7 @@ def update(self, config): """Update self from a dict, file or filename.""" - if isinstance(config, basestring): + if isinstance(config, text_or_bytes): # Filename config = Parser().dict_from_file(config) elif hasattr(config, 'read'): @@ -192,7 +192,7 @@ return optionstr def read(self, filenames): - if isinstance(filenames, basestring): + if isinstance(filenames, text_or_bytes): filenames = [filenames] for filename in filenames: # try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/process/plugins.py new/CherryPy-7.1.0/cherrypy/process/plugins.py --- old/CherryPy-7.0.0/cherrypy/process/plugins.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/process/plugins.py 2016-07-25 22:35:49.000000000 +0200 @@ -7,7 +7,7 @@ import time import threading -from cherrypy._cpcompat import basestring, get_daemon, get_thread_ident +from cherrypy._cpcompat import text_or_bytes, get_daemon, get_thread_ident from cherrypy._cpcompat import ntob, Timer, SetDaemonProperty # _module__file__base is used by Autoreload to make @@ -176,7 +176,7 @@ If the given signal name or number is not available on the current platform, ValueError is raised. """ - if isinstance(signal, basestring): + if isinstance(signal, text_or_bytes): signum = getattr(_signal, signal, None) if signum is None: raise ValueError("No such signal: %r" % signal) @@ -242,7 +242,7 @@ self.bus.log("pwd module not available; ignoring uid.", level=30) val = None - elif isinstance(val, basestring): + elif isinstance(val, text_or_bytes): val = pwd.getpwnam(val)[2] self._uid = val uid = property(_get_uid, _set_uid, @@ -257,7 +257,7 @@ self.bus.log("grp module not available; ignoring gid.", level=30) val = None - elif isinstance(val, basestring): + elif isinstance(val, text_or_bytes): val = grp.getgrnam(val)[2] self._gid = val gid = property(_get_gid, _set_gid, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/process/servers.py new/CherryPy-7.1.0/cherrypy/process/servers.py --- old/CherryPy-7.0.0/cherrypy/process/servers.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/process/servers.py 2016-07-25 22:35:49.000000000 +0200 @@ -113,6 +113,7 @@ an explanation of the possible configuration options. """ +import os import sys import time import warnings @@ -227,9 +228,12 @@ time.sleep(.1) # Wait for port to be occupied - if isinstance(self.bind_addr, tuple): - host, port = self.bind_addr - wait_for_occupied_port(host, port) + if not os.environ.get('LISTEN_PID', None): + # Wait for port to be occupied if not running via socket-activation + # (for socket-activation the port will be managed by systemd ) + if isinstance(self.bind_addr, tuple): + host, port = self.bind_addr + wait_for_occupied_port(host, port) def stop(self): """Stop the HTTP server.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/test/helper.py new/CherryPy-7.1.0/cherrypy/test/helper.py --- old/CherryPy-7.0.0/cherrypy/test/helper.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/test/helper.py 2016-07-25 22:35:49.000000000 +0200 @@ -14,7 +14,7 @@ import warnings import cherrypy -from cherrypy._cpcompat import basestring, copyitems, HTTPSConnection, ntob +from cherrypy._cpcompat import text_or_bytes, copyitems, HTTPSConnection, ntob from cherrypy.lib import httputil from cherrypy.lib import gctools from cherrypy.lib.reprconf import unrepr @@ -48,7 +48,7 @@ _conf = testconfig.config.get('supervisor', None) if _conf is not None: for k, v in _conf.items(): - if isinstance(v, basestring): + if isinstance(v, text_or_bytes): _conf[k] = unrepr(v) conf.update(_conf) except ImportError: @@ -253,7 +253,7 @@ if sys.platform[:4] == 'java': cherrypy.config.update({'server.nodelay': False}) - if isinstance(conf, basestring): + if isinstance(conf, text_or_bytes): parser = cherrypy.lib.reprconf.Parser() conf = parser.dict_from_file(conf).get('global', {}) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/test/logtest.py new/CherryPy-7.1.0/cherrypy/test/logtest.py --- old/CherryPy-7.0.0/cherrypy/test/logtest.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/test/logtest.py 2016-07-25 22:35:49.000000000 +0200 @@ -5,7 +5,7 @@ import six -from cherrypy._cpcompat import basestring, ntob +from cherrypy._cpcompat import text_or_bytes, ntob try: @@ -187,7 +187,7 @@ # Multiple args. Use __getslice__ and require lines to be list. if isinstance(lines, tuple): lines = list(lines) - elif isinstance(lines, basestring): + elif isinstance(lines, text_or_bytes): raise TypeError("The 'lines' arg must be a list when " "'sliceargs' is a tuple.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/test/static/Слава Україні.html new/CherryPy-7.1.0/cherrypy/test/static/Слава Україні.html --- old/CherryPy-7.0.0/cherrypy/test/static/Слава Україні.html 1970-01-01 01:00:00.000000000 +0100 +++ new/CherryPy-7.1.0/cherrypy/test/static/Слава Україні.html 2016-07-25 22:35:49.000000000 +0200 @@ -0,0 +1 @@ +Героям Слава! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/test/test_static.py new/CherryPy-7.1.0/cherrypy/test/test_static.py --- old/CherryPy-7.0.0/cherrypy/test/test_static.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/test/test_static.py 2016-07-25 22:35:49.000000000 +0200 @@ -1,8 +1,13 @@ +# -*- coding: utf-8 -*- import os import sys import io -from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob +from six.moves import urllib + +from cherrypy._cpcompat import ( + HTTPConnection, HTTPSConnection, ntob, ntou, tonative, +) curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) has_space_filepath = os.path.join(curdir, 'static', 'has space.html') @@ -20,6 +25,7 @@ class StaticTest(helper.CPWebCase): + @staticmethod def setup_server(): if not os.path.exists(has_space_filepath): open(has_space_filepath, 'wb').write(ntob('Hello, world\r\n')) @@ -108,8 +114,8 @@ vhost = cherrypy._cpwsgi.VirtualHost(rootApp, {'virt.net': testApp}) cherrypy.tree.graft(vhost) - setup_server = staticmethod(setup_server) + @staticmethod def teardown_server(): for f in (has_space_filepath, bigfile_filepath): if os.path.exists(f): @@ -117,7 +123,6 @@ os.unlink(f) except: pass - teardown_server = staticmethod(teardown_server) def test_static(self): self.getPage("/static/index.html") @@ -339,6 +344,17 @@ self.getPage("/static/\x00") self.assertStatus('404 Not Found') + def test_unicode(self): + url = ntou("/static/Слава Україні.html", 'utf-8') + # quote function requires str + url = tonative(url, 'utf-8') + url = urllib.parse.quote(url) + self.getPage(url) + + expected = ntou("Героям Слава!", 'utf-8') + self.assertInBody(expected) + + def error_page_404(status, message, traceback, version): import os.path return static.serve_file(os.path.join(curdir, 'static', '404.html'), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/test/webtest.py new/CherryPy-7.1.0/cherrypy/test/webtest.py --- old/CherryPy-7.0.0/cherrypy/test/webtest.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/test/webtest.py 2016-07-25 22:35:49.000000000 +0200 @@ -26,12 +26,11 @@ import os import json -from unittest import * -from unittest import _TextTestResult +import unittest import six -from cherrypy._cpcompat import basestring, ntob, HTTPConnection +from cherrypy._cpcompat import text_or_bytes, HTTPConnection from cherrypy._cpcompat import HTTPSConnection @@ -49,7 +48,7 @@ return host -class TerseTestResult(_TextTestResult): +class TerseTestResult(unittest._TextTestResult): def printErrors(self): # Overridden to avoid unnecessary empty line @@ -60,7 +59,7 @@ self.printErrorList('FAIL', self.failures) -class TerseTestRunner(TextTestRunner): +class TerseTestRunner(unittest.TextTestRunner): """A test runner class that displays results in textual form.""" @@ -86,7 +85,7 @@ return result -class ReloadingTestLoader(TestLoader): +class ReloadingTestLoader(unittest.TestLoader): def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. @@ -129,7 +128,7 @@ return self.loadTestsFromModule(obj) elif (((six.PY3 and isinstance(obj, type)) or isinstance(obj, (type, types.ClassType))) - and issubclass(obj, TestCase)): + and issubclass(obj, unittest.TestCase)): return self.loadTestsFromTestCase(obj) elif isinstance(obj, types.UnboundMethodType): if six.PY3: @@ -138,8 +137,8 @@ return obj.im_class(obj.__name__) elif hasattr(obj, '__call__'): test = obj() - if not isinstance(test, TestCase) and \ - not isinstance(test, TestSuite): + if not isinstance(test, unittest.TestCase) and \ + not isinstance(test, unittest.TestSuite): raise ValueError("calling %s returned %s, " "not a test" % (obj, test)) return test @@ -188,7 +187,7 @@ return self.fget(obj) -class WebCase(TestCase): +class WebCase(unittest.TestCase): HOST = "127.0.0.1" PORT = 8000 HTTP_CONN = HTTPConnection @@ -350,7 +349,7 @@ def assertStatus(self, status, msg=None): """Fail if self.status != status.""" - if isinstance(status, basestring): + if isinstance(status, text_or_bytes): if not self.status == status: if msg is None: msg = 'Status (%r) != %r' % (self.status, status) @@ -365,7 +364,7 @@ # status is a tuple or list. match = False for s in status: - if isinstance(s, basestring): + if isinstance(s, text_or_bytes): if self.status == s: match = True break diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/cherrypy/wsgiserver/__init__.py new/CherryPy-7.1.0/cherrypy/wsgiserver/__init__.py --- old/CherryPy-7.0.0/cherrypy/wsgiserver/__init__.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/cherrypy/wsgiserver/__init__.py 2016-07-25 22:35:49.000000000 +0200 @@ -1925,7 +1925,10 @@ interface" (INADDR_ANY), and '::' is the similar IN6ADDR_ANY for IPv6. The empty string or None are not allowed. - For UNIX sockets, supply the filename as a string.""") + For UNIX sockets, supply the filename as a string. + + Systemd socket activation is automatic and doesn't require tempering + with this variable""") def start(self): """Run the server forever.""" @@ -1939,7 +1942,11 @@ self.software = "%s Server" % self.version # Select the appropriate socket - if isinstance(self.bind_addr, six.string_types): + self.socket = None + if os.getenv('LISTEN_PID', None): + # systemd socket activation + self.socket = socket.fromfd(3, socket.AF_INET, socket.SOCK_STREAM) + elif isinstance(self.bind_addr, six.string_types): # AF_UNIX socket # So we can reuse the socket... @@ -1973,21 +1980,21 @@ info = [(socket.AF_INET, socket.SOCK_STREAM, 0, "", self.bind_addr)] - self.socket = None - msg = "No socket could be created" - for res in info: - af, socktype, proto, canonname, sa = res - try: - self.bind(af, socktype, proto) - except socket.error as serr: - msg = "%s -- (%s: %s)" % (msg, sa, serr) - if self.socket: - self.socket.close() - self.socket = None - continue - break if not self.socket: - raise socket.error(msg) + msg = "No socket could be created" + for res in info: + af, socktype, proto, canonname, sa = res + try: + self.bind(af, socktype, proto) + break + except socket.error as serr: + msg = "%s -- (%s: %s)" % (msg, sa, serr) + if self.socket: + self.socket.close() + self.socket = None + + if not self.socket: + raise socket.error(msg) # Timeout so KeyboardInterrupt can be caught on Win32 self.socket.settimeout(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/setup.cfg new/CherryPy-7.1.0/setup.cfg --- old/CherryPy-7.0.0/setup.cfg 2016-07-24 18:16:11.000000000 +0200 +++ new/CherryPy-7.1.0/setup.cfg 2016-07-25 22:37:11.000000000 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 7.0.0 +current_version = 7.1.0 commit = True tag = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CherryPy-7.0.0/setup.py new/CherryPy-7.1.0/setup.py --- old/CherryPy-7.0.0/setup.py 2016-07-24 18:14:49.000000000 +0200 +++ new/CherryPy-7.1.0/setup.py 2016-07-25 22:35:49.000000000 +0200 @@ -54,7 +54,7 @@ # arguments for the setup command ############################################################################### name = "CherryPy" -version = "7.0.0" +version = "7.1.0" desc = "Object-Oriented HTTP framework" long_desc = "CherryPy is a pythonic, object-oriented HTTP framework" classifiers = [