Hello community, here is the log from the commit of package python-Paste for openSUSE:Factory checked in at 2020-01-16 18:15:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Paste (Old) and /work/SRC/openSUSE:Factory/.python-Paste.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Paste" Thu Jan 16 18:15:42 2020 rev:26 rq:764619 version:3.2.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Paste/python-Paste.changes 2020-01-01 14:58:26.885935794 +0100 +++ /work/SRC/openSUSE:Factory/.python-Paste.new.26092/python-Paste.changes 2020-01-16 18:16:01.120797574 +0100 @@ -1,0 +2,9 @@ +Wed Jan 15 10:54:10 UTC 2020 - Marketa Calabkova <[email protected]> + +- update to 3.2.6 + * Correctly handle HEAD requests (to send empty body) when gzip encoding requested. + * Use is_alive instead of isAlive for Python 3.9 compatibility. + * Use encodebytes instead of deprecated encodestring. + * Fix Python 2 and 3 compatibility for base64. + +------------------------------------------------------------------- Old: ---- Paste-3.2.3.tar.gz New: ---- Paste-3.2.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Paste.spec ++++++ --- /var/tmp/diff_new_pack.PIsd7n/_old 2020-01-16 18:16:02.716798478 +0100 +++ /var/tmp/diff_new_pack.PIsd7n/_new 2020-01-16 18:16:02.720798479 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-Paste # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Paste -Version: 3.2.3 +Version: 3.2.6 Release: 0 Summary: Tools for using a Web Server Gateway Interface stack License: MIT ++++++ Paste-3.2.3.tar.gz -> Paste-3.2.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/PKG-INFO new/Paste-3.2.6/PKG-INFO --- old/Paste-3.2.3/PKG-INFO 2019-11-25 22:07:03.000000000 +0100 +++ new/Paste-3.2.6/PKG-INFO 2020-01-13 13:49:12.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Paste -Version: 3.2.3 +Version: 3.2.6 Summary: Tools for using a Web Server Gateway Interface stack Home-page: https://pythonpaste.readthedocs.io/ Author: Chris Dent @@ -130,8 +130,8 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server Classifier: Framework :: Paste -Provides-Extra: Flup -Provides-Extra: hotshot Provides-Extra: subprocess +Provides-Extra: hotshot +Provides-Extra: Flup Provides-Extra: Paste Provides-Extra: openid diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/Paste.egg-info/PKG-INFO new/Paste-3.2.6/Paste.egg-info/PKG-INFO --- old/Paste-3.2.3/Paste.egg-info/PKG-INFO 2019-11-25 22:07:02.000000000 +0100 +++ new/Paste-3.2.6/Paste.egg-info/PKG-INFO 2020-01-13 13:49:12.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Paste -Version: 3.2.3 +Version: 3.2.6 Summary: Tools for using a Web Server Gateway Interface stack Home-page: https://pythonpaste.readthedocs.io/ Author: Chris Dent @@ -130,8 +130,8 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server Classifier: Framework :: Paste -Provides-Extra: Flup -Provides-Extra: hotshot Provides-Extra: subprocess +Provides-Extra: hotshot +Provides-Extra: Flup Provides-Extra: Paste Provides-Extra: openid diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/docs/news.txt new/Paste-3.2.6/docs/news.txt --- old/Paste-3.2.3/docs/news.txt 2019-11-25 22:05:12.000000000 +0100 +++ new/Paste-3.2.6/docs/news.txt 2020-01-13 13:47:14.000000000 +0100 @@ -3,6 +3,21 @@ .. contents:: +3.2.6 +----- + +* Correctly handle HEAD requests (to send empty body) when gzip + encoding requested. + +3.2.4 +----- + +* Use is_alive instead of isAlive for Python 3.9 compatibility. +* Use encodebytes instead of deprecated encodestring. +* Fix Python 2 and 3 compatibility for base64. + +Thanks to tirkarthi for these fixes. + 3.2.3 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/paste/auth/cookie.py new/Paste-3.2.6/paste/auth/cookie.py --- old/Paste-3.2.3/paste/auth/cookie.py 2018-10-24 15:03:13.000000000 +0200 +++ new/Paste-3.2.6/paste/auth/cookie.py 2020-01-05 14:55:49.000000000 +0100 @@ -144,10 +144,17 @@ if six.PY3: content = content.encode('utf8') timestamp = timestamp.encode('utf8') - cookie = base64.encodestring( - hmac.new(self.secret, content, sha1).digest() + - timestamp + - content) + + if six.PY3: + cookie = base64.encodebytes( + hmac.new(self.secret, content, sha1).digest() + + timestamp + + content) + else: + cookie = base64.encodestring( + hmac.new(self.secret, content, sha1).digest() + + timestamp + + content) cookie = cookie.replace(b"/", b"_").replace(b"=", b"~") cookie = cookie.replace(b'\n', b'').replace(b'\r', b'') if len(cookie) > self.maxlen: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/paste/fixture.py new/Paste-3.2.6/paste/fixture.py --- old/Paste-3.2.3/paste/fixture.py 2019-09-25 14:27:36.000000000 +0200 +++ new/Paste-3.2.6/paste/fixture.py 2020-01-13 13:41:14.000000000 +0100 @@ -299,6 +299,18 @@ extra_environ=extra_environ,status=status, upload_files=None, expect_errors=expect_errors) + def head(self, url, headers=None, extra_environ=None, + status=None, expect_errors=False): + """ + Do a HEAD request. Very like the ``.get()`` method. + + Returns a `response object + <class-paste.fixture.TestResponse.html>`_ + """ + return self._gen_request('HEAD', url, headers=headers, + extra_environ=extra_environ,status=status, + upload_files=None, expect_errors=expect_errors) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/paste/gzipper.py new/Paste-3.2.6/paste/gzipper.py --- old/Paste-3.2.3/paste/gzipper.py 2018-10-24 15:03:13.000000000 +0200 +++ new/Paste-3.2.6/paste/gzipper.py 2020-01-13 13:41:14.000000000 +0100 @@ -25,9 +25,12 @@ self.compress_level = int(compress_level) def __call__(self, environ, start_response): - if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING', ''): + if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING', '') \ + or environ['REQUEST_METHOD'] == 'HEAD': # nothing for us to do, so this middleware will - # be a no-op: + # be a no-op (there's no body expected in the HEAD case, + # and if we open a GzipFile we would produce an erroneous + # 20-byte header and trailer): return self.application(environ, start_response) response = GzipResponse(start_response, self.compress_level) app_iter = self.application(environ, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/paste/httpserver.py new/Paste-3.2.6/paste/httpserver.py --- old/Paste-3.2.3/paste/httpserver.py 2019-11-25 22:04:00.000000000 +0100 +++ new/Paste-3.2.6/paste/httpserver.py 2020-01-05 14:55:49.000000000 +0100 @@ -952,7 +952,7 @@ hung_workers = [] for worker in self.workers: worker.join(0.5) - if worker.isAlive(): + if worker.is_alive(): hung_workers.append(worker) zombies = [] for thread_id in self.dying_threads: @@ -969,10 +969,10 @@ timed_out = False need_force_quit = bool(zombies) for worker in self.workers: - if not timed_out and worker.isAlive(): + if not timed_out and worker.is_alive(): timed_out = True worker.join(force_quit_timeout) - if worker.isAlive(): + if worker.is_alive(): print("Worker %s won't die" % worker) need_force_quit = True if need_force_quit: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/paste/registry.py new/Paste-3.2.6/paste/registry.py --- old/Paste-3.2.3/paste/registry.py 2018-10-24 15:03:13.000000000 +0200 +++ new/Paste-3.2.6/paste/registry.py 2020-01-09 13:32:52.000000000 +0100 @@ -125,7 +125,7 @@ """Return a list of the StackedObjectProxy's and proxied object's (if one exists) names. """ - dir_list = dir(self.__class__) + self.__dict__.keys() + dir_list = dir(self.__class__) + list(self.__dict__.keys()) try: dir_list.extend(dir(self._current_obj())) except TypeError: @@ -165,6 +165,9 @@ def __iter__(self): return iter(self._current_obj()) + def __bool__(self): + return bool(self._current_obj()) + def __len__(self): return len(self._current_obj()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/setup.py new/Paste-3.2.6/setup.py --- old/Paste-3.2.3/setup.py 2019-11-25 22:04:31.000000000 +0100 +++ new/Paste-3.2.6/setup.py 2020-01-13 13:45:58.000000000 +0100 @@ -12,7 +12,7 @@ # - git push # - python setup.py sdist bdist_wheel upload --sign -__version__ = '3.2.3' +__version__ = '3.2.6' from setuptools import setup, find_packages import sys, os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Paste-3.2.3/tests/test_gzipper.py new/Paste-3.2.6/tests/test_gzipper.py --- old/Paste-3.2.3/tests/test_gzipper.py 2018-10-24 15:03:13.000000000 +0200 +++ new/Paste-3.2.6/tests/test_gzipper.py 2020-01-13 13:41:14.000000000 +0100 @@ -4,8 +4,10 @@ import six def simple_app(environ, start_response): - start_response('200 OK', [('content-type', 'text/plain')]) - return [b'this is a test'] + start_response('200 OK', + [('content-type', 'text/plain'), + ('content-length', '0')]) + return [b'this is a test'] if environ['REQUEST_METHOD'] != 'HEAD' else [] wsgi_app = middleware(simple_app) app = TestApp(wsgi_app) @@ -17,3 +19,9 @@ assert res.body != b'this is a test' actual = gzip.GzipFile(fileobj=six.BytesIO(res.body)).read() assert actual == b'this is a test' + +def test_gzip_head(): + res = app.head( + '/', extra_environ=dict(HTTP_ACCEPT_ENCODING='gzip')) + assert int(res.header('content-length')) == 0 + assert res.body == b''
