Hello community,

here is the log from the commit of package python3 for openSUSE:Factory checked 
in at 2020-06-28 23:03:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3 (Old)
 and      /work/SRC/openSUSE:Factory/.python3.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3"

Sun Jun 28 23:03:05 2020 rev:99 rq:816829 version:3.8.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3/python3-base.changes     2020-06-11 
14:42:57.789064693 +0200
+++ /work/SRC/openSUSE:Factory/.python3.new.3060/python3-base.changes   
2020-06-28 23:03:14.790244961 +0200
@@ -1,0 +2,5 @@
+Wed Jun 17 18:42:51 UTC 2020 - Matej Cepl <[email protected]>
+
+- Replace OBS_dev-shm.patch with the upstream PR#20944
+
+-------------------------------------------------------------------
python3-doc.changes: same change
python3.changes: same change

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

Other differences:
------------------
python3-doc.spec: same change
python3.spec: same change
++++++ OBS_dev-shm.patch ++++++
--- /var/tmp/diff_new_pack.Bj9Qa5/_old  2020-06-28 23:03:16.190249610 +0200
+++ /var/tmp/diff_new_pack.Bj9Qa5/_new  2020-06-28 23:03:16.190249610 +0200
@@ -1,25 +1,175 @@
---- a/Lib/test/test_asyncio/test_events.py
-+++ b/Lib/test/test_asyncio/test_events.py
-@@ -13,6 +13,7 @@ try:
-     import ssl
- except ImportError:
-     ssl = None
-+import stat
- import subprocess
- import sys
+From 0edba4a774f8fc6867d49ebd2d9c6831901e30dd Mon Sep 17 00:00:00 2001
+From: Victor Stinner <[email protected]>
+Date: Wed, 17 Jun 2020 17:53:48 +0200
+Subject: [PATCH] bpo-38377: Add
+ support.skip_if_broken_multiprocessing_synchronize()
+
+On Linux, skip tests using multiprocessing if the current user cannot
+create a file in /dev/shm/ directory. Add the
+skip_if_broken_multiprocessing_synchronize() function to the
+test.support module.
+---
+ Doc/library/test.rst                          |  8 +++++++
+ Lib/test/_test_multiprocessing.py             |  2 +-
+ Lib/test/support/__init__.py                  | 22 +++++++++++++++++++
+ Lib/test/test_asyncio/test_events.py          |  4 ++--
+ Lib/test/test_concurrent_futures.py           |  2 +-
+ Lib/test/test_logging.py                      |  8 +++----
+ .../test_multiprocessing_main_handling.py     |  2 +-
+ Lib/test/test_venv.py                         |  8 ++++---
+ .../2020-06-17-18-00-21.bpo-38377.jfg4TH.rst  |  4 ++++
+ 9 files changed, 48 insertions(+), 12 deletions(-)
+ create mode 100644 
Misc/NEWS.d/next/Tests/2020-06-17-18-00-21.bpo-38377.jfg4TH.rst
+
+--- a/Doc/library/test.rst
++++ b/Doc/library/test.rst
+@@ -1282,6 +1282,14 @@ The :mod:`test.support` module defines t
+ 
+    .. versionadded:: 3.6
+ 
++.. function:: skip_if_broken_multiprocessing_synchronize()
++
++   Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if
++   there is no available semaphore implementation, or if creating a lock 
raises
++   an :exc:`OSError`.
++
++   .. versionadded:: 3.10
++
+ 
+ The :mod:`test.support` module defines the following classes:
+ 
+--- a/Lib/test/_test_multiprocessing.py
++++ b/Lib/test/_test_multiprocessing.py
+@@ -31,7 +31,7 @@ from test import support
+ # Skip tests if _multiprocessing wasn't built.
+ _multiprocessing = test.support.import_module('_multiprocessing')
+ # Skip tests if sem_open implementation is broken.
+-test.support.import_module('multiprocessing.synchronize')
++support.skip_if_broken_multiprocessing_synchronize()
  import threading
-@@ -2633,7 +2634,8 @@ class GetEventLoopTestsMixin:
-             asyncio.get_event_loop = self.get_event_loop_saved
  
+ import multiprocessing.connection
+--- a/Lib/test/support/__init__.py
++++ b/Lib/test/support/__init__.py
+@@ -3350,3 +3350,25 @@ class catch_threading_exception:
+         del self.exc_value
+         del self.exc_traceback
+         del self.thread
++
++def skip_if_broken_multiprocessing_synchronize():
++    """
++    Skip tests if the multiprocessing.synchronize module is missing, if there
++    is no available semaphore implementation, or if creating a lock raises an
++    OSError.
++    """
++
++    # Skip tests if the _multiprocessing extension is missing.
++    import_module('_multiprocessing')
++
++    # Skip tests if there is no available semaphore implementation:
++    # multiprocessing.synchronize requires _multiprocessing.SemLock.
++    synchronize = import_module('multiprocessing.synchronize')
++
++    try:
++        # bpo-38377: On Linux, creating a semaphore is the current user
++        # does not have the permission to create a file in /dev/shm.
++        # Create a semaphore to check permissions.
++        synchronize.Lock(ctx=None)
++    except OSError as exc:
++        raise unittest.SkipTest(f"broken multiprocessing SemLock: {exc!r}")
+--- a/Lib/test/test_asyncio/test_events.py
++++ b/Lib/test/test_asyncio/test_events.py
+@@ -2635,10 +2635,10 @@ class GetEventLoopTestsMixin:
      if sys.platform != 'win32':
--
-+        @unittest.skipUnless(os.path.exists("/dev/shm") and 
stat.S_IMODE(os.stat('/dev/shm').st_mode) >= 0o777,
-+                             "Doesn't work without /dev/shm.")
+ 
          def test_get_event_loop_new_process(self):
-             # Issue bpo-32126: The multiprocessing module used by
+-            # Issue bpo-32126: The multiprocessing module used by
++            # bpo-32126: The multiprocessing module used by
              # ProcessPoolExecutor is not functional when the
+             # multiprocessing.synchronize module cannot be imported.
+-            support.import_module('multiprocessing.synchronize')
++            support.skip_if_broken_multiprocessing_synchronize()
+ 
+             async def main():
+                 pool = concurrent.futures.ProcessPoolExecutor()
+--- a/Lib/test/test_concurrent_futures.py
++++ b/Lib/test/test_concurrent_futures.py
+@@ -3,7 +3,7 @@ import test.support
+ # Skip tests if _multiprocessing wasn't built.
+ test.support.import_module('_multiprocessing')
+ # Skip tests if sem_open implementation is broken.
+-test.support.import_module('multiprocessing.synchronize')
++test.support.skip_if_broken_multiprocessing_synchronize()
+ 
+ from test.support.script_helper import assert_python_ok
+ 
+--- a/Lib/test/test_logging.py
++++ b/Lib/test/test_logging.py
+@@ -3621,9 +3621,9 @@ if hasattr(logging.handlers, 'QueueListe
+ 
+         @patch.object(logging.handlers.QueueListener, 'handle')
+         def test_handle_called_with_mp_queue(self, mock_handle):
+-            # Issue 28668: The multiprocessing (mp) module is not functional
++            # bpo-28668: The multiprocessing (mp) module is not functional
+             # when the mp.synchronize module cannot be imported.
+-            support.import_module('multiprocessing.synchronize')
++            support.skip_if_broken_multiprocessing_synchronize()
+             for i in range(self.repeat):
+                 log_queue = multiprocessing.Queue()
+                 self.setup_and_log(log_queue, '%s_%s' % (self.id(), i))
+@@ -3647,9 +3647,9 @@ if hasattr(logging.handlers, 'QueueListe
+             indicates that messages were not registered on the queue until
+             _after_ the QueueListener stopped.
+             """
+-            # Issue 28668: The multiprocessing (mp) module is not functional
++            # bpo-28668: The multiprocessing (mp) module is not functional
+             # when the mp.synchronize module cannot be imported.
+-            support.import_module('multiprocessing.synchronize')
++            support.skip_if_broken_multiprocessing_synchronize()
+             for i in range(self.repeat):
+                 queue = multiprocessing.Queue()
+                 self.setup_and_log(queue, '%s_%s' %(self.id(), i))
+--- a/Lib/test/test_multiprocessing_main_handling.py
++++ b/Lib/test/test_multiprocessing_main_handling.py
+@@ -23,7 +23,7 @@ import multiprocessing
+ AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods())
+ 
+ # Issue #22332: Skip tests if sem_open implementation is broken.
+-support.import_module('multiprocessing.synchronize')
++support.skip_if_broken_multiprocessing_synchronize()
+ 
+ verbose = support.verbose
+ 
+--- a/Lib/test/test_venv.py
++++ b/Lib/test/test_venv.py
+@@ -16,7 +16,8 @@ import sys
+ import tempfile
+ from test.support import (captured_stdout, captured_stderr, requires_zlib,
+                           can_symlink, EnvironmentVarGuard, rmtree,
+-                          import_module)
++                          import_module,
++                          skip_if_broken_multiprocessing_synchronize)
+ import threading
+ import unittest
+ import venv
+@@ -324,10 +325,11 @@ class BasicTest(BaseTest):
+         """
+         Test that the multiprocessing is able to spawn.
+         """
+-        # Issue bpo-36342: Instanciation of a Pool object imports the
++        # bpo-36342: Instantiation of a Pool object imports the
+         # multiprocessing.synchronize module. Skip the test if this module
+         # cannot be imported.
+-        import_module('multiprocessing.synchronize')
++        skip_if_broken_multiprocessing_synchronize()
++
+         rmtree(self.env_dir)
+         self.run_with_capture(venv.create, self.env_dir)
+         envpy = os.path.join(os.path.realpath(self.env_dir),
 --- /dev/null
-+++ b/Misc/NEWS.d/next/Tests/2019-10-05-15-50-24.bpo-38377.gKfVDt.rst
-@@ -0,0 +1,2 @@
-+Skip test_get_event_loop_new_process on systems which don’t provide it
-+(e.g., building environments of some Linux distributions).
++++ b/Misc/NEWS.d/next/Tests/2020-06-17-18-00-21.bpo-38377.jfg4TH.rst
+@@ -0,0 +1,4 @@
++On Linux, skip tests using multiprocessing if the current user cannot create
++a file in ``/dev/shm/`` directory. Add the
++:func:`~test.support.skip_if_broken_multiprocessing_synchronize` function to
++the :mod:`test.support` module.




Reply via email to