Hello community,

here is the log from the commit of package python-bjoern for openSUSE:Factory 
checked in at 2019-07-08 15:12:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-bjoern (Old)
 and      /work/SRC/openSUSE:Factory/.python-bjoern.new.4615 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-bjoern"

Mon Jul  8 15:12:54 2019 rev:8 rq:714016 version:3.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-bjoern/python-bjoern.changes      
2019-05-24 11:33:40.985359971 +0200
+++ /work/SRC/openSUSE:Factory/.python-bjoern.new.4615/python-bjoern.changes    
2019-07-08 16:37:24.304651680 +0200
@@ -1,0 +2,6 @@
+Sun Jul  7 16:50:15 UTC 2019 - Michael Ströder <[email protected]>
+
+- version update to 3.0.1
+  * Fix #158, #160: Correct string type for WSGI environ
+
+-------------------------------------------------------------------

Old:
----
  bjoern-3.0.0.tar.gz

New:
----
  bjoern-3.0.1.tar.gz

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

Other differences:
------------------
++++++ python-bjoern.spec ++++++
--- /var/tmp/diff_new_pack.AvgoIH/_old  2019-07-08 16:37:25.552653505 +0200
+++ /var/tmp/diff_new_pack.AvgoIH/_new  2019-07-08 16:37:25.556653511 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-bjoern
-Version:        3.0.0
+Version:        3.0.1
 Release:        0
 Summary:        A screamingly fast Python 2 + 3 WSGI server written in C
 License:        BSD-2-Clause

++++++ bjoern-3.0.0.tar.gz -> bjoern-3.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/CHANGELOG new/bjoern-3.0.1/CHANGELOG
--- old/bjoern-3.0.0/CHANGELOG  2019-05-07 15:15:06.000000000 +0200
+++ new/bjoern-3.0.1/CHANGELOG  2019-06-07 12:31:44.000000000 +0200
@@ -1,3 +1,6 @@
+3.0.1 (June 6, 2019)
+    - Fix #158, #160: Correct string type for WSGI environ
+
 3.0.0 (May 7, 2019)
     - Fix #91: Support for SIGTERM/SIGINT handling
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/PKG-INFO new/bjoern-3.0.1/PKG-INFO
--- old/bjoern-3.0.0/PKG-INFO   2019-05-07 15:15:20.000000000 +0200
+++ new/bjoern-3.0.1/PKG-INFO   2019-06-07 12:32:21.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: bjoern
-Version: 3.0.0
+Version: 3.0.1
 Summary: A screamingly fast Python 2 + 3 WSGI server written in C.
 Home-page: https://github.com/jonashaag/bjoern
 Author: Jonas Haag
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/bjoern/_bjoernmodule.c 
new/bjoern-3.0.1/bjoern/_bjoernmodule.c
--- old/bjoern-3.0.0/bjoern/_bjoernmodule.c     2019-05-07 15:14:17.000000000 
+0200
+++ new/bjoern-3.0.1/bjoern/_bjoernmodule.c     2019-06-07 12:32:00.000000000 
+0200
@@ -79,11 +79,11 @@
     return NULL;
   }
 
-  PyModule_AddObject(bjoern_module, "version", Py_BuildValue("(iii)", 3, 0, 
0));
+  PyModule_AddObject(bjoern_module, "version", Py_BuildValue("(iii)", 3, 0, 
1));
   return bjoern_module;
 #else
   PyObject* bjoern_module = Py_InitModule("_bjoern", Bjoern_FunctionTable);
-  PyModule_AddObject(bjoern_module, "version", Py_BuildValue("(iii)", 3, 0, 
0));
+  PyModule_AddObject(bjoern_module, "version", Py_BuildValue("(iii)", 3, 0, 
1));
 #endif
 
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/bjoern/py2py3.h 
new/bjoern-3.0.1/bjoern/py2py3.h
--- old/bjoern-3.0.0/bjoern/py2py3.h    2018-08-06 13:45:24.000000000 +0200
+++ new/bjoern-3.0.1/bjoern/py2py3.h    2019-05-27 16:04:07.000000000 +0200
@@ -15,6 +15,7 @@
 #define _PEP3333_BytesLatin1_FromUnicode(u) PyUnicode_AsLatin1String(u)
 #define _PEP3333_String_FromUTF8String(data) PyUnicode_FromString(data)
 #define _PEP3333_String_FromLatin1StringAndSize(data, len) 
PyUnicode_DecodeLatin1(data, len, "replace")
+#define _PEP3333_String_FromFormat(...) PyUnicode_FromFormat(__VA_ARGS__)
 #define _PEP3333_String_GET_SIZE(u) PyUnicode_GET_LENGTH(u)
 #define _PEP3333_String_Concat(u1, u2) PyUnicode_Concat(u1, u2)
 
@@ -29,6 +30,7 @@
 #define _PEP3333_Bytes_Resize(bytes, len) _PyString_Resize(bytes, len)
 #define _PEP3333_BytesLatin1_FromUnicode(u) (Py_INCREF(u),u)
 #define _PEP3333_String_FromUTF8String(data) PyString_FromString(data) // 
Assume UTF8
+#define _PEP3333_String_FromFormat(...) PyString_FromFormat(__VA_ARGS__)
 #define _PEP3333_String_GET_SIZE(u) PyString_GET_SIZE(u)
 
 static PyObject* _PEP3333_String_FromLatin1StringAndSize(const char* data, 
Py_ssize_t len)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/bjoern/request.c 
new/bjoern-3.0.1/bjoern/request.c
--- old/bjoern-3.0.0/bjoern/request.c   2018-08-06 13:44:51.000000000 +0200
+++ new/bjoern-3.0.1/bjoern/request.c   2019-06-07 12:29:15.000000000 +0200
@@ -348,14 +348,14 @@
       PyDict_SetItemString(wsgi_base_dict, "SERVER_NAME", server_info->host);
 
       if (server_info->port == Py_None) {
-      PyDict_SetItemString(wsgi_base_dict, "SERVER_PORT", 
PyUnicode_FromFormat(""));
+      PyDict_SetItemString(wsgi_base_dict, "SERVER_PORT", 
_PEP3333_String_FromFormat(""));
       } else {
-        PyDict_SetItemString(wsgi_base_dict, "SERVER_PORT", 
PyUnicode_FromFormat("%i", server_info->port));
+        PyDict_SetItemString(wsgi_base_dict, "SERVER_PORT", 
_PEP3333_String_FromFormat("%i", server_info->port));
       }
      } else {
       /* SERVER_NAME is required, but not usefull with UNIX type sockets */
-      PyDict_SetItemString(wsgi_base_dict, "SERVER_NAME", 
PyUnicode_FromFormat(""));
-      PyDict_SetItemString(wsgi_base_dict, "SERVER_PORT", 
PyUnicode_FromFormat(""));
+      PyDict_SetItemString(wsgi_base_dict, "SERVER_NAME", 
_PEP3333_String_FromFormat(""));
+      PyDict_SetItemString(wsgi_base_dict, "SERVER_PORT", 
_PEP3333_String_FromFormat(""));
     }
   }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/bjoern.egg-info/PKG-INFO 
new/bjoern-3.0.1/bjoern.egg-info/PKG-INFO
--- old/bjoern-3.0.0/bjoern.egg-info/PKG-INFO   2019-05-07 15:15:19.000000000 
+0200
+++ new/bjoern-3.0.1/bjoern.egg-info/PKG-INFO   2019-06-07 12:32:21.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: bjoern
-Version: 3.0.0
+Version: 3.0.1
 Summary: A screamingly fast Python 2 + 3 WSGI server written in C.
 Home-page: https://github.com/jonashaag/bjoern
 Author: Jonas Haag
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/bjoern.py new/bjoern-3.0.1/bjoern.py
--- old/bjoern-3.0.0/bjoern.py  2019-05-07 15:12:17.000000000 +0200
+++ new/bjoern-3.0.1/bjoern.py  2019-05-27 16:04:07.000000000 +0200
@@ -4,10 +4,11 @@
 
 
 _default_instance = None
-LISTEN_BACKLOG = 1024
+DEFAULT_LISTEN_BACKLOG = 1024
 
 
-def bind_and_listen(host, port=None, reuse_port=False):
+def bind_and_listen(host, port=None, reuse_port=False,
+                    listen_backlog=DEFAULT_LISTEN_BACKLOG):
     if host.startswith("unix:@"):
         # Abstract UNIX socket: "unix:@foobar"
         sock = socket.socket(socket.AF_UNIX)
@@ -23,13 +24,13 @@
         sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         if reuse_port:
             # Enable "receive steering" on FreeBSD and Linux >=3.9. This allows
-            # multiple independent bjoerns to bind to the same port (and 
ideally
-            # also set their CPU affinity), resulting in more efficient load
-            # distribution.  https://lwn.net/Articles/542629/
+            # multiple independent bjoerns to bind to the same port (and
+            # ideally also set their CPU affinity), resulting in more efficient
+            # load distribution.  https://lwn.net/Articles/542629/
             sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
         sock.bind((host, port))
 
-    sock.listen(LISTEN_BACKLOG)
+    sock.listen(listen_backlog)
 
     return sock
 
@@ -39,19 +40,23 @@
 
 
 # Backwards compatibility API
-def listen(wsgi_app, host, port=None, reuse_port=False):
+def listen(wsgi_app, host, port=None, reuse_port=False,
+           listen_backlog=DEFAULT_LISTEN_BACKLOG):
     """
     Makes bjoern listen to 'host:port' and use 'wsgi_app' as WSGI application.
     (This does not run the server mainloop.)
 
     'reuse_port' -- whether to set SO_REUSEPORT (if available on platform)
+    'listen_backlog' -- listen backlog value (default: 1024)
     """
     global _default_instance
     if _default_instance:
         raise RuntimeError("Only one global server instance possible")
-    sock = bind_and_listen(host, port, reuse_port)
+    sock = bind_and_listen(host, port, reuse_port,
+                           listen_backlog=listen_backlog)
     _default_instance = (sock, wsgi_app)
 
+
 def run(*args, **kwargs):
     """
     run(*args, **kwargs):
@@ -70,7 +75,8 @@
         # Called as `bjoern.run()`
         if not _default_instance:
             raise RuntimeError("Must call bjoern.listen(wsgi_app, host, ...) "
-                               "before calling bjoern.run() without 
arguments.")
+                               "before calling bjoern.run() without "
+                               "arguments.")
 
     sock, wsgi_app = _default_instance
     try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/setup.py new/bjoern-3.0.1/setup.py
--- old/bjoern-3.0.0/setup.py   2019-05-07 15:14:27.000000000 +0200
+++ new/bjoern-3.0.1/setup.py   2019-06-07 12:31:52.000000000 +0200
@@ -26,7 +26,7 @@
     license      = '2-clause BSD',
     url          = 'https://github.com/jonashaag/bjoern',
     description  = 'A screamingly fast Python 2 + 3 WSGI server written in C.',
-    version      = '3.0.0',
+    version      = '3.0.1',
     classifiers  = ['Development Status :: 4 - Beta',
                     'License :: OSI Approved :: BSD License',
                     'Programming Language :: C',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bjoern-3.0.0/tests/test_wsgi_compliance.py 
new/bjoern-3.0.1/tests/test_wsgi_compliance.py
--- old/bjoern-3.0.0/tests/test_wsgi_compliance.py      2018-02-14 
10:42:37.000000000 +0100
+++ new/bjoern-3.0.1/tests/test_wsgi_compliance.py      2019-06-07 
12:29:15.000000000 +0200
@@ -40,6 +40,6 @@
     try:
         test_compliance()
     except AssertionError:
-        print("Test failed")
+        raise SystemExit("Test failed")
     else:
         print("Test successful")


Reply via email to