Hello community,

here is the log from the commit of package python-Paste for openSUSE:Factory 
checked in at 2019-09-30 15:55:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Paste (Old)
 and      /work/SRC/openSUSE:Factory/.python-Paste.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-Paste"

Mon Sep 30 15:55:02 2019 rev:23 rq:732889 version:3.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Paste/python-Paste.changes        
2019-08-06 15:07:53.263870920 +0200
+++ /work/SRC/openSUSE:Factory/.python-Paste.new.2352/python-Paste.changes      
2019-09-30 15:55:06.709901178 +0200
@@ -1,0 +2,8 @@
+Tue Sep 24 09:25:15 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 3.2.0:
+  * Ensure unicode URLs work in TestApp.
+  * Make LimitedLengthFile file return empty bytes.
+  * Protect against accidental close in FieldStorage.
+
+-------------------------------------------------------------------

Old:
----
  Paste-3.1.0.tar.gz

New:
----
  Paste-3.2.0.tar.gz

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

Other differences:
------------------
++++++ python-Paste.spec ++++++
--- /var/tmp/diff_new_pack.ruP1GV/_old  2019-09-30 15:55:07.709898516 +0200
+++ /var/tmp/diff_new_pack.ruP1GV/_new  2019-09-30 15:55:07.709898516 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define oldpython python
 Name:           python-Paste
-Version:        3.1.0
+Version:        3.2.0
 Release:        0
 Summary:        Tools for using a Web Server Gateway Interface stack
 License:        MIT
@@ -33,12 +33,12 @@
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-six > 1.4.0
-BuildArch:      noarch
 Suggests:       python-flup
+BuildArch:      noarch
 %ifpython2
+Suggests:       python-python-openid
 Provides:       %{oldpython}-paste = %{version}
 Obsoletes:      %{oldpython}-paste < %{version}
-Suggests:       python-python-openid
 %endif
 %ifpython3
 Suggests:       python3-python3-openid
@@ -66,7 +66,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} 
py.test-%{$python_bin_suffix} -v
+%pytest
 
 %files %{python_files}
 %license docs/license.txt

++++++ Paste-3.1.0.tar.gz -> Paste-3.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/PKG-INFO new/Paste-3.2.0/PKG-INFO
--- old/Paste-3.1.0/PKG-INFO    2019-07-24 12:54:34.000000000 +0200
+++ new/Paste-3.2.0/PKG-INFO    2019-09-05 12:31:04.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: Paste
-Version: 3.1.0
+Version: 3.2.0
 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: openid
 Provides-Extra: Flup
+Provides-Extra: hotshot
 Provides-Extra: subprocess
 Provides-Extra: Paste
-Provides-Extra: hotshot
-Provides-Extra: openid
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/Paste.egg-info/PKG-INFO 
new/Paste-3.2.0/Paste.egg-info/PKG-INFO
--- old/Paste-3.1.0/Paste.egg-info/PKG-INFO     2019-07-24 12:54:34.000000000 
+0200
+++ new/Paste-3.2.0/Paste.egg-info/PKG-INFO     2019-09-05 12:31:04.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: Paste
-Version: 3.1.0
+Version: 3.2.0
 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: openid
 Provides-Extra: Flup
+Provides-Extra: hotshot
 Provides-Extra: subprocess
 Provides-Extra: Paste
-Provides-Extra: hotshot
-Provides-Extra: openid
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/docs/news.txt 
new/Paste-3.2.0/docs/news.txt
--- old/Paste-3.1.0/docs/news.txt       2019-07-24 12:51:47.000000000 +0200
+++ new/Paste-3.2.0/docs/news.txt       2019-09-05 12:27:36.000000000 +0200
@@ -3,6 +3,21 @@
 
 .. contents::
 
+3.2.0
+-----
+
+* Ensure unicode URLs work in TestApp.
+* Make LimitedLengthFile file return empty bytes.
+* Protect against accidental close in FieldStorage.
+
+Thanks to benjaminp for many recent contributions.
+
+
+3.1.1
+-----
+
+* TestApp.encode_multipart handles bytes filenames and params.
+
 3.1.0
 -----
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/paste/fixture.py 
new/Paste-3.2.0/paste/fixture.py
--- old/Paste-3.1.0/paste/fixture.py    2018-10-31 10:57:07.000000000 +0100
+++ new/Paste-3.2.0/paste/fixture.py    2019-09-05 12:21:52.000000000 +0200
@@ -235,6 +235,7 @@
             environ['CONTENT_TYPE'] = content_type
         elif params:
             environ.setdefault('CONTENT_TYPE', 
'application/x-www-form-urlencoded')
+        url = str(url)
         if '?' in url:
             url, environ['QUERY_STRING'] = url.split('?', 1)
         else:
@@ -330,28 +331,20 @@
         lines = []
         for key, value in params:
             lines.append(b'--'+boundary)
-            line = 'Content-Disposition: form-data; name="%s"' % key
-            if six.PY3:
-                line = line.encode('utf8')
+            line = b'Content-Disposition: form-data; name="%s"' % 
six.ensure_binary(key)
             lines.append(line)
             lines.append(b'')
-            line = value
-            if six.PY3 and isinstance(line, six.text_type):
-                line = line.encode('utf8')
+            line = six.ensure_binary(value)
             lines.append(line)
         for file_info in files:
             key, filename, value = self._get_file_info(file_info)
             lines.append(b'--'+boundary)
-            line = ('Content-Disposition: form-data; name="%s"; filename="%s"'
-                         % (key, filename))
-            if six.PY3:
-                line = line.encode('utf8')
+            line = (b'Content-Disposition: form-data; name="%s"; filename="%s"'
+                         % (six.ensure_binary(key), 
six.ensure_binary(filename)))
             lines.append(line)
-            fcontent = mimetypes.guess_type(filename)[0]
-            line = ('Content-Type: %s'
-                    % (fcontent or 'application/octet-stream'))
-            if six.PY3:
-                line = line.encode('utf8')
+            fcontent = mimetypes.guess_type(six.ensure_str(filename, 'ascii', 
'ignore'))[0]
+            line = (b'Content-Type: %s'
+                    % (fcontent.encode('ascii') if fcontent else 
b'application/octet-stream'))
             lines.append(line)
             lines.append(b'')
             lines.append(value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/paste/httpserver.py 
new/Paste-3.2.0/paste/httpserver.py
--- old/Paste-3.1.0/paste/httpserver.py 2019-07-24 12:46:25.000000000 +0200
+++ new/Paste-3.2.0/paste/httpserver.py 2019-09-05 12:21:52.000000000 +0200
@@ -487,7 +487,7 @@
             length = min(length, left)
         # next two lines are hnecessary only if read(0) blocks
         if not left:
-            return ''
+            return b''
         data = self.file.read(length)
         self._consumed += len(data)
         return data
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/paste/util/multidict.py 
new/Paste-3.2.0/paste/util/multidict.py
--- old/Paste-3.1.0/paste/util/multidict.py     2019-07-24 12:46:25.000000000 
+0200
+++ new/Paste-3.2.0/paste/util/multidict.py     2019-09-05 12:21:52.000000000 
+0200
@@ -265,11 +265,13 @@
         """
         if isinstance(value, cgi.FieldStorage):
             # decode FieldStorage's field name and filename
-            value = copy.copy(value)
-            if self.decode_keys and isinstance(value.name, six.binary_type):
-                value.name = value.name.decode(self.encoding, self.errors)
-            if six.PY2:
-                value.filename = value.filename.decode(self.encoding, 
self.errors)
+            decode_name = self.decode_keys and isinstance(value.name, 
six.binary_type)
+            if six.PY2 or decode_name:
+                value = copy.copy(value)
+                if decode_name:
+                    value.name = value.name.decode(self.encoding, self.errors)
+                if six.PY2:
+                    value.filename = value.filename.decode(self.encoding, 
self.errors)
         else:
             try:
                 value = value.decode(self.encoding, self.errors)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/setup.py new/Paste-3.2.0/setup.py
--- old/Paste-3.1.0/setup.py    2019-07-24 12:48:35.000000000 +0200
+++ new/Paste-3.2.0/setup.py    2019-09-05 12:22:38.000000000 +0200
@@ -12,7 +12,7 @@
 # - git push
 # - python setup.py sdist bdist_wheel upload --sign
 
-__version__ = '3.1.0'
+__version__ = '3.2.0'
 
 from setuptools import setup, find_packages
 import sys, os
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/tests/test_fixture.py 
new/Paste-3.2.0/tests/test_fixture.py
--- old/Paste-3.1.0/tests/test_fixture.py       2018-10-31 10:57:07.000000000 
+0100
+++ new/Paste-3.2.0/tests/test_fixture.py       2019-09-05 12:21:52.000000000 
+0200
@@ -1,5 +1,8 @@
+import cgi
+
 from paste.debug.debugapp import SimpleApplication, SlowConsumer
 from paste.fixture import TestApp
+from paste.wsgiwrappers import WSGIRequest
 
 
 def test_fixture():
@@ -44,3 +47,35 @@
                                   ('Content-Length', str(len(body)))])
         return [body]
     TestApp(response).get('/')
+
+def test_params_and_upload_files():
+    class PostApp(object):
+        def __call__(self, environ, start_response):
+            start_response("204 No content", [])
+            self.request = WSGIRequest(environ)
+            return [b'']
+    post_app = PostApp()
+    app = TestApp(post_app)
+    app.post(
+        '/',
+        params={'param1': 'a', 'param2': 'b'},
+        upload_files=[
+            ('file1', 'myfile.txt', b'data1'),
+            ('file2', b'yourfile.txt', b'data2'),
+        ],
+    )
+    params = post_app.request.params
+    assert len(params) == 4
+    assert params['param1'] == 'a'
+    assert params['param2'] == 'b'
+    assert params['file1'].value == b'data1'
+    assert params['file1'].filename == 'myfile.txt'
+    assert params['file2'].value == b'data2'
+    assert params['file2'].filename == 'yourfile.txt'
+
+def test_unicode_path():
+    app = TestApp(SimpleApplication())
+    app.get(u"/?")
+    app.post(u"/?")
+    app.put(u"/?")
+    app.delete(u"/?")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/tests/test_httpserver.py 
new/Paste-3.2.0/tests/test_httpserver.py
--- old/Paste-3.1.0/tests/test_httpserver.py    2018-10-24 15:03:13.000000000 
+0200
+++ new/Paste-3.2.0/tests/test_httpserver.py    2019-09-05 12:21:52.000000000 
+0200
@@ -1,6 +1,7 @@
 import email
+import io
 
-from paste.httpserver import WSGIHandler
+from paste.httpserver import LimitedLengthFile, WSGIHandler
 from six.moves import StringIO
 
 
@@ -43,3 +44,10 @@
     wsgi_handler.wsgi_setup()
 
     assert wsgi_handler.wsgi_environ['HTTP_HOST'] == 'host1,host2'
+
+
+def test_limited_length_file():
+    backing = io.BytesIO(b'0123456789')
+    f = LimitedLengthFile(backing, 9)
+    assert f.read() == b'012345678'
+    assert f.read() == b''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/tests/test_multidict.py 
new/Paste-3.2.0/tests/test_multidict.py
--- old/Paste-3.1.0/tests/test_multidict.py     2018-10-24 15:03:13.000000000 
+0200
+++ new/Paste-3.2.0/tests/test_multidict.py     2019-09-05 12:21:52.000000000 
+0200
@@ -2,10 +2,11 @@
 # (c) 2007 Ian Bicking and Philip Jenvey; written for Paste 
(http://pythonpaste.org)
 # Licensed under the MIT license: 
http://www.opensource.org/licenses/mit-license.php
 import cgi
+import gc
+import io
 
 import pytest
 import six
-from six.moves import StringIO
 
 from paste.util.multidict import MultiDict, UnicodeMultiDict
 
@@ -149,14 +150,16 @@
     fs = cgi.FieldStorage()
     fs.name = 'thefile'
     fs.filename = 'hello.txt'
-    fs.file = StringIO('hello')
+    fs.file = io.BytesIO(b'hello')
     d[k('f')] = fs
     ufs = d[k('f')]
     assert isinstance(ufs, cgi.FieldStorage)
-    assert ufs is not fs
     assert ufs.name == fs.name
     assert isinstance(ufs.name, str if six.PY3 else key_str)
     assert ufs.filename == fs.filename
     assert isinstance(ufs.filename, six.text_type)
-    assert isinstance(ufs.value, str)
-    assert ufs.value == 'hello'
+    assert isinstance(ufs.value, bytes)
+    assert ufs.value == b'hello'
+    ufs = None
+    gc.collect()
+    assert not fs.file.closed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Paste-3.1.0/tests/test_wsgiwrappers.py 
new/Paste-3.2.0/tests/test_wsgiwrappers.py
--- old/Paste-3.1.0/tests/test_wsgiwrappers.py  2019-07-24 12:46:25.000000000 
+0200
+++ new/Paste-3.2.0/tests/test_wsgiwrappers.py  2019-09-05 12:21:52.000000000 
+0200
@@ -96,7 +96,7 @@
         return []
 
     app = TestApp(handle_fileupload)
-    res = app.post('/', upload_files=[('thefile', '寿司.txt', b'Sushi')])
+    res = app.post('/', upload_files=[('thefile', u'寿司.txt'.encode('utf-8'), 
b'Sushi')])
 
 def test_wsgiresponse_charset():
     response = WSGIResponse(mimetype='text/html; charset=UTF-8')


Reply via email to