From fe8d1e61fa7623a183ef9a162d8c80d331bd279f Mon Sep 17 00:00:00 2001 From: tommoral Date: Fri, 21 Mar 2025 14:03:38 +0100 Subject: [PATCH 1/8] CI trigger From 6b0de64f3f83eb526638e65db4c6dc52cb5ca232 Mon Sep 17 00:00:00 2001 From: tommoral Date: Fri, 21 Mar 2025 14:16:59 +0100 Subject: [PATCH 2/8] TST check if error in cloudpickle or in cpython --- tests/cloudpickle_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index 00467e35..2e2c49c8 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -2519,6 +2519,8 @@ def __getattribute__(self, name): return getattr(self, name) a = A() + with pytest.raises(RecursionError): + a.test with pytest.raises(pickle.PicklingError, match="recursion"): cloudpickle.dumps(a) From 074f01d3309061eb5423fc457e2fd07f4f7bc829 Mon Sep 17 00:00:00 2001 From: tommoral Date: Fri, 21 Mar 2025 14:25:10 +0100 Subject: [PATCH 3/8] MTN see if this comes from the latest alpha release --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a7becfb4..4f71ebc8 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev", "pypy-3.9"] + python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.5", "pypy-3.9"] exclude: # Do not test all minor versions on all platforms, especially if they # are not the oldest/newest supported versions From 0d096159f4a83c82cc91667fd067d16273800706 Mon Sep 17 00:00:00 2001 From: tommoral Date: Fri, 21 Mar 2025 14:46:41 +0100 Subject: [PATCH 4/8] DBG test reproducer for cpython --- .github/workflows/testing.yml | 1 + test_recursion_error.py | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 test_recursion_error.py diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 4f71ebc8..de6455fd 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -61,6 +61,7 @@ jobs: python -m pip install -e . python -m pip install -r dev-requirements.txt python ci/install_coverage_subprocess_pth.py + python test_recursion_error.py export - name: Display Python version shell: bash diff --git a/test_recursion_error.py b/test_recursion_error.py new file mode 100644 index 00000000..0c3fd772 --- /dev/null +++ b/test_recursion_error.py @@ -0,0 +1,11 @@ +class A: + def __getattribute__(self, name): + return getattr(self, name) + + +a = A() +print("Testing Recursion Limit") +try: + a.test +except RecursionError: + print("Recursion Limit ok") From 380015c20d97a39f35ae597333ab4d1808270e4a Mon Sep 17 00:00:00 2001 From: tommoral Date: Fri, 21 Mar 2025 14:52:26 +0100 Subject: [PATCH 5/8] DBG test with dev version --- .github/workflows/testing.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index de6455fd..3d779c3a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-alpha.5", "pypy-3.9"] + python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev", "pypy-3.9"] exclude: # Do not test all minor versions on all platforms, especially if they # are not the oldest/newest supported versions @@ -61,11 +61,13 @@ jobs: python -m pip install -e . python -m pip install -r dev-requirements.txt python ci/install_coverage_subprocess_pth.py - python test_recursion_error.py export - name: Display Python version shell: bash run: python -c "import sys; print(sys.version)" + - name: Test Python recursion limit + shell: bash + run: python test_recursion_error.py - name: Test with pytest shell: bash run: | From 30b00eb7f1800a8e9b4b14e3d58c3d70f0225b2b Mon Sep 17 00:00:00 2001 From: tommoral Date: Fri, 21 Mar 2025 15:00:45 +0100 Subject: [PATCH 6/8] MTN skip recursion test on 3.14 for now as this segfault the interpreter on OSX --- .github/workflows/testing.yml | 3 --- test_recursion_error.py | 11 ----------- tests/cloudpickle_test.py | 4 ++++ 3 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 test_recursion_error.py diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3d779c3a..a7becfb4 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -65,9 +65,6 @@ jobs: - name: Display Python version shell: bash run: python -c "import sys; print(sys.version)" - - name: Test Python recursion limit - shell: bash - run: python test_recursion_error.py - name: Test with pytest shell: bash run: | diff --git a/test_recursion_error.py b/test_recursion_error.py deleted file mode 100644 index 0c3fd772..00000000 --- a/test_recursion_error.py +++ /dev/null @@ -1,11 +0,0 @@ -class A: - def __getattribute__(self, name): - return getattr(self, name) - - -a = A() -print("Testing Recursion Limit") -try: - a.test -except RecursionError: - print("Recursion Limit ok") diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index 2e2c49c8..9067052a 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -2511,6 +2511,10 @@ def inner_function(): sys.version_info < (3, 9), reason="Can cause CPython 3.8 to segfault", ) + @pytest.mark.skipif( + sys.version_info > (3, 14), + reason="Can cause CPython 3.14 to segfault", + ) # TODO: remove this xfail when we drop support for Python 3.8. We don't # plan to fix it because Python 3.8 is EOL. def test_recursion_during_pickling(self): From 59851a39255ec44aca128c2ee8bd4f24cae1d0ad Mon Sep 17 00:00:00 2001 From: tommoral Date: Fri, 21 Mar 2025 15:03:16 +0100 Subject: [PATCH 7/8] MTN remove debug tests --- tests/cloudpickle_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index 9067052a..f258e916 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -2523,8 +2523,6 @@ def __getattribute__(self, name): return getattr(self, name) a = A() - with pytest.raises(RecursionError): - a.test with pytest.raises(pickle.PicklingError, match="recursion"): cloudpickle.dumps(a) From e5430fb0467854470ed8d9449cc877840f74fa6a Mon Sep 17 00:00:00 2001 From: tommoral Date: Tue, 25 Mar 2025 10:12:14 +0100 Subject: [PATCH 8/8] CLN add comments on why we skip 3.14 --- tests/cloudpickle_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index f258e916..72aa132f 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -2507,16 +2507,18 @@ def inner_function(): inner_func = depickled_factory() assert inner_func() == _TEST_GLOBAL_VARIABLE + # TODO: remove this xfail when we drop support for Python 3.8. We don't + # plan to fix it because Python 3.8 is EOL. @pytest.mark.skipif( sys.version_info < (3, 9), reason="Can cause CPython 3.8 to segfault", ) @pytest.mark.skipif( sys.version_info > (3, 14), - reason="Can cause CPython 3.14 to segfault", + reason="Can cause CPython 3.14 interpreter to crash", + # This interpreter crash is reported upstream in + # https://github.com/python/cpython/issues/131543 ) - # TODO: remove this xfail when we drop support for Python 3.8. We don't - # plan to fix it because Python 3.8 is EOL. def test_recursion_during_pickling(self): class A: def __getattribute__(self, name):