From 13c5b057917deb4e51def0b83911cfe9d478a909 Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Tue, 11 Feb 2020 07:59:54 -0500 Subject: [PATCH 01/12] Hard reset + cherry piciking the changes. --- Lib/importlib/_bootstrap_external.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 2434cf06fd44445..13f0191839cda41 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -35,7 +35,7 @@ def _make_relax_case(): def _relax_case(): """True if filenames must be checked case-insensitively.""" - return key in _os.environ + return not sys.flags.ignore_environment and key in _os.environ else: def _relax_case(): """True if filenames must be checked case-insensitively.""" From fdecdf01b96d90d7f91f29d3e783a88fb455a230 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2020 13:01:40 +0000 Subject: [PATCH 02/12] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst diff --git a/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst b/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst new file mode 100644 index 000000000000000..c66e735ec284e91 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst @@ -0,0 +1 @@ +Updated :meth:`importlib._bootstrap_external._make_relax_case` to ignore :envvar:`PYTHONCASEOK` when -E or -I flags are used. \ No newline at end of file From 29d13c9a52171bbb880f29b981f8763cbab0dbfb Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Tue, 11 Feb 2020 20:15:24 -0500 Subject: [PATCH 03/12] Added @vstinner News --- .../next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst b/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst index c66e735ec284e91..34f2677df52e2ba 100644 --- a/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst +++ b/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst @@ -1 +1,2 @@ -Updated :meth:`importlib._bootstrap_external._make_relax_case` to ignore :envvar:`PYTHONCASEOK` when -E or -I flags are used. \ No newline at end of file +The :mod:`importlib` module now ignore the :envvar:`PYTHONCASEOK` +environment variable when :option:`-E` or :option:`-I` command line option is used. \ No newline at end of file From 135259fdaf83ad0c95ee12dbeeb5ecbeadcc5422 Mon Sep 17 00:00:00 2001 From: idomic Date: Thu, 13 Feb 2020 14:31:17 -0500 Subject: [PATCH 04/12] Update Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst Co-Authored-By: Victor Stinner --- .../next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst b/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst index 34f2677df52e2ba..913c8ccb1c21c1e 100644 --- a/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst +++ b/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst @@ -1,2 +1,2 @@ -The :mod:`importlib` module now ignore the :envvar:`PYTHONCASEOK` -environment variable when :option:`-E` or :option:`-I` command line option is used. \ No newline at end of file +The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK` +environment variable when :option:`-E` or :option:`-I` command line option is used. From 0c3e3cf5b90e3ef16a05ac633bbc17066170edaf Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Sun, 16 Feb 2020 16:09:08 -0500 Subject: [PATCH 05/12] [bpo-39244] multiprocessing.get_all_start_methods() wrong default on macOS --- Lib/multiprocessing/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/multiprocessing/context.py b/Lib/multiprocessing/context.py index 5f8e0f0cd46585c..7f48adb3f6a84c3 100644 --- a/Lib/multiprocessing/context.py +++ b/Lib/multiprocessing/context.py @@ -254,7 +254,7 @@ def get_start_method(self, allow_none=False): return self._actual_context._name def get_all_start_methods(self): - if sys.platform == 'win32': + if sys.platform == 'win32' or sys.platform == 'darwin': return ['spawn'] else: if reduction.HAVE_SEND_HANDLE: From 4be42f0705cc8531c728519a1d4988129571675a Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Sun, 16 Feb 2020 16:15:37 -0500 Subject: [PATCH 06/12] Removed residues --- Lib/importlib/_bootstrap_external.py | 2 +- .../next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 13f0191839cda41..2434cf06fd44445 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -35,7 +35,7 @@ def _make_relax_case(): def _relax_case(): """True if filenames must be checked case-insensitively.""" - return not sys.flags.ignore_environment and key in _os.environ + return key in _os.environ else: def _relax_case(): """True if filenames must be checked case-insensitively.""" diff --git a/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst b/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst deleted file mode 100644 index 913c8ccb1c21c1e..000000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst +++ /dev/null @@ -1,2 +0,0 @@ -The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK` -environment variable when :option:`-E` or :option:`-I` command line option is used. From 23f1b9cc633df3dc378a47b09c7f0c7fc3a411e2 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2020 21:24:19 +0000 Subject: [PATCH 07/12] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst diff --git a/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst new file mode 100644 index 000000000000000..8466fb97ba1370c --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst @@ -0,0 +1,2 @@ +Fixed default :class:`multiprocessing.context` in :method: `get_all_start_methods` +if the context is macOS, return the default 'spawn' \ No newline at end of file From ac7ad3fc21498f7ec5be1cb8e234ac6ac78b916c Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Sun, 16 Feb 2020 16:28:03 -0500 Subject: [PATCH 08/12] Removed residues --- Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst index 8466fb97ba1370c..f6bd4d7536a4c12 100644 --- a/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst +++ b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst @@ -1,2 +1,2 @@ Fixed default :class:`multiprocessing.context` in :method: `get_all_start_methods` -if the context is macOS, return the default 'spawn' \ No newline at end of file +if the context is macOS, return the default 'spawn' From f360bec7efa84cebbf398cd05924f90e02cf47c4 Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Mon, 17 Feb 2020 07:21:40 -0500 Subject: [PATCH 09/12] [bpo-39244] added reviewers comments --- Lib/multiprocessing/context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/multiprocessing/context.py b/Lib/multiprocessing/context.py index 7f48adb3f6a84c3..67f3993c2e9dff8 100644 --- a/Lib/multiprocessing/context.py +++ b/Lib/multiprocessing/context.py @@ -254,8 +254,10 @@ def get_start_method(self, allow_none=False): return self._actual_context._name def get_all_start_methods(self): - if sys.platform == 'win32' or sys.platform == 'darwin': + if sys.platform == 'win32': return ['spawn'] + elif sys.platform == 'darwin': + return ['spawn', 'fork', 'forkserver'] else: if reduction.HAVE_SEND_HANDLE: return ['fork', 'spawn', 'forkserver'] From 39b8661a8baead27389d007489c4c2cd2a97a3c9 Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Mon, 17 Feb 2020 07:24:32 -0500 Subject: [PATCH 10/12] [bpo-39244] added reviewers comments --- Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst index f6bd4d7536a4c12..eb18892f85871ca 100644 --- a/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst +++ b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst @@ -1,2 +1,2 @@ -Fixed default :class:`multiprocessing.context` in :method: `get_all_start_methods` +Fixed default :class: `multiprocessing.context` in :method: `get_all_start_methods` if the context is macOS, return the default 'spawn' From f303b8fd62f098eaef7c838c420ec28a0e08a866 Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Mon, 17 Feb 2020 07:35:34 -0500 Subject: [PATCH 11/12] [bpo-39244] added reviewers comments --- Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst index eb18892f85871ca..c7a0b485062971c 100644 --- a/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst +++ b/Misc/NEWS.d/next/macOS/2020-02-16-21-24-18.bpo-39244.QGqhjT.rst @@ -1,2 +1,2 @@ -Fixed default :class: `multiprocessing.context` in :method: `get_all_start_methods` +Fixed default :class:`multiprocessing.context` in :func:`get_all_start_methods` if the context is macOS, return the default 'spawn' From c08304173a87cb6594d5de7c2251a711415d7632 Mon Sep 17 00:00:00 2001 From: Ido Michael Date: Sat, 22 Feb 2020 19:55:13 -0500 Subject: [PATCH 12/12] [bpo-39244] Fixed failing test --- Lib/test/_test_multiprocessing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 4e48cd45e14ca74..24798a1f398ff55 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -4982,6 +4982,8 @@ def test_get_all(self): methods = multiprocessing.get_all_start_methods() if sys.platform == 'win32': self.assertEqual(methods, ['spawn']) + elif sys.platform == 'darwin': + self.assertEqual(methods, ['spawn', 'fork', 'forkserver']) else: self.assertTrue(methods == ['fork', 'spawn'] or methods == ['fork', 'spawn', 'forkserver'])