Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-portpicker for 
openSUSE:Factory checked in at 2022-07-19 17:19:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-portpicker (Old)
 and      /work/SRC/openSUSE:Factory/.python-portpicker.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-portpicker"

Tue Jul 19 17:19:57 2022 rev:6 rq:990215 version:1.5.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-portpicker/python-portpicker.changes      
2022-04-08 00:28:17.597935365 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-portpicker.new.1523/python-portpicker.changes
    2022-07-19 17:20:30.828458774 +0200
@@ -1,0 +2,9 @@
+Tue Jul 19 11:16:35 UTC 2022 - Dirk M??ller <[email protected]>
+
+- update to 1.5.2:
+  * Do not re-pick a known used (not-yet-returned) port when running stand 
alone
+    without a portserver.
+  * When not using a portserver *(you really should)*, try the `bind(0)`
+    approach before hunting for random unused ports. More reliable per
+
+-------------------------------------------------------------------

Old:
----
  portpicker-1.5.0.tar.gz

New:
----
  portpicker-1.5.2.tar.gz

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

Other differences:
------------------
++++++ python-portpicker.spec ++++++
--- /var/tmp/diff_new_pack.xT9LcF/_old  2022-07-19 17:20:31.248459334 +0200
+++ /var/tmp/diff_new_pack.xT9LcF/_new  2022-07-19 17:20:31.252459340 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-portpicker
-Version:        1.5.0
+Version:        1.5.2
 Release:        0
 Summary:        A library to choose unique available network ports
 License:        Apache-2.0

++++++ portpicker-1.5.0.tar.gz -> portpicker-1.5.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portpicker-1.5.0/ChangeLog.md 
new/portpicker-1.5.2/ChangeLog.md
--- old/portpicker-1.5.0/ChangeLog.md   2021-11-09 03:17:28.000000000 +0100
+++ new/portpicker-1.5.2/ChangeLog.md   2022-06-08 22:16:19.000000000 +0200
@@ -1,3 +1,14 @@
+## 1.5.2
+
+*   Do not re-pick a known used (not-yet-returned) port when running stand 
alone
+    without a portserver.
+    
+## 1.5.1
+
+*   When not using a portserver *(you really should)*, try the `bind(0)`
+    approach before hunting for random unused ports. More reliable per
+    https://github.com/google/python_portpicker/issues/16.
+
 ## 1.5.0
 
 *   Add portserver support to Windows using named pipes. To create or connect 
to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portpicker-1.5.0/PKG-INFO 
new/portpicker-1.5.2/PKG-INFO
--- old/portpicker-1.5.0/PKG-INFO       2021-11-09 03:19:26.347873200 +0100
+++ new/portpicker-1.5.2/PKG-INFO       2022-06-08 22:56:07.827623800 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: portpicker
-Version: 1.5.0
+Version: 1.5.2
 Summary: A library to choose unique available network ports.
 Home-page: https://github.com/google/python_portpicker
 Maintainer: Google LLC
@@ -31,4 +31,3 @@
 allocation of network ports on a single build/test farm host across all
 processes willing to use a port server aware port picker library such as
 this one.
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portpicker-1.5.0/setup.cfg 
new/portpicker-1.5.2/setup.cfg
--- old/portpicker-1.5.0/setup.cfg      2021-11-09 03:19:26.347873200 +0100
+++ new/portpicker-1.5.2/setup.cfg      2022-06-08 22:56:07.827623800 +0200
@@ -1,6 +1,6 @@
 [metadata]
 name = portpicker
-version = 1.5.0
+version = 1.5.2
 maintainer = Google LLC
 maintainer_email = [email protected]
 license = Apache 2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portpicker-1.5.0/src/portpicker.egg-info/PKG-INFO 
new/portpicker-1.5.2/src/portpicker.egg-info/PKG-INFO
--- old/portpicker-1.5.0/src/portpicker.egg-info/PKG-INFO       2021-11-09 
03:19:26.000000000 +0100
+++ new/portpicker-1.5.2/src/portpicker.egg-info/PKG-INFO       2022-06-08 
22:56:07.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: portpicker
-Version: 1.5.0
+Version: 1.5.2
 Summary: A library to choose unique available network ports.
 Home-page: https://github.com/google/python_portpicker
 Maintainer: Google LLC
@@ -31,4 +31,3 @@
 allocation of network ports on a single build/test farm host across all
 processes willing to use a port server aware port picker library such as
 this one.
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portpicker-1.5.0/src/portpicker.py 
new/portpicker-1.5.2/src/portpicker.py
--- old/portpicker-1.5.0/src/portpicker.py      2021-07-12 03:38:42.000000000 
+0200
+++ new/portpicker-1.5.2/src/portpicker.py      2022-06-08 22:54:14.000000000 
+0200
@@ -198,14 +198,6 @@
     Raises:
       NoFreePortFoundError: No free port could be found.
     """
-    # Try random ports first.
-    rng = random.Random()
-    for _ in range(10):
-        port = int(rng.randrange(15000, 25000))
-        if is_port_free(port):
-            _random_ports.add(port)
-            return port
-
     # Next, try a few times to get an OS-assigned port.
     # Ambrose discovered that on the 2.6 kernel, calling Bind() on UDP socket
     # returns the same port over and over. So always try TCP first.
@@ -213,7 +205,16 @@
         # Ask the OS for an unused port.
         port = bind(0, _PROTOS[0][0], _PROTOS[0][1])
         # Check if this port is unused on the other protocol.
-        if port and bind(port, _PROTOS[1][0], _PROTOS[1][1]):
+        if (port and port not in _random_ports and
+            bind(port, _PROTOS[1][0], _PROTOS[1][1])):
+            _random_ports.add(port)
+            return port
+
+    # Try random ports as a last resort.
+    rng = random.Random()
+    for _ in range(10):
+        port = int(rng.randrange(15000, 25000))
+        if port not in _random_ports and is_port_free(port):
             _random_ports.add(port)
             return port
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portpicker-1.5.0/src/tests/portpicker_test.py 
new/portpicker-1.5.2/src/tests/portpicker_test.py
--- old/portpicker-1.5.0/src/tests/portpicker_test.py   2021-07-12 
03:38:42.000000000 +0200
+++ new/portpicker-1.5.2/src/tests/portpicker_test.py   2021-11-09 
03:49:11.000000000 +0100
@@ -272,7 +272,7 @@
                 self.assertTrue(self.IsUnusedTCPPort(port))
                 self.assertTrue(self.IsUnusedUDPPort(port))
                 ports += 1
-            self.assertGreater(ports, 95)
+            self.assertGreater(ports, 70)
 
     def pickUnusedPortWithoutServer(self):
         # Try a few times to pick a port, to avoid flakiness and to make sure

Reply via email to