From 3bb72dd601747e6a880ca3086d5679de52cadcfbb6e36a06906a35cf011f2c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 2 Nov 2023 12:31:00 +0000 Subject: [PATCH] Accepting request 1122463 from home:jirislaby:branches:devel:languages:python - add tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch (kernel 6.6 fix) OBS-URL: https://build.opensuse.org/request/show/1122463 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-anyio?expand=0&rev=29 --- python-anyio.changes | 6 ++++ python-anyio.spec | 2 ++ ...leio.py-don-t-follow-symlinks-in-dev.patch | 33 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch diff --git a/python-anyio.changes b/python-anyio.changes index 17f587b..2f92e3d 100644 --- a/python-anyio.changes +++ b/python-anyio.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 2 10:42:51 UTC 2023 - Jiri Slaby + +- add tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch (kernel + 6.6 fix) + ------------------------------------------------------------------- Thu May 4 07:29:22 UTC 2023 - Steve Kowalik diff --git a/python-anyio.spec b/python-anyio.spec index 990feb4..13037fd 100644 --- a/python-anyio.spec +++ b/python-anyio.spec @@ -28,6 +28,8 @@ Source: https://files.pythonhosted.org/packages/source/a/anyio/anyio-%{v Patch0: support-trio-0.22.patch # PATCH-FIX-UPSTREAM Based on gh#agronholm/anyio#553 Patch1: fix-failing-tls-tests.patch +# PATCH-FIX-UPSTREAM see gh#agronholm/anyio#626 +Patch2: tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch BuildRequires: %{python_module contextlib2 if %python-base < 3.7} BuildRequires: %{python_module dataclasses if %python-base < 3.7} BuildRequires: %{python_module idna >= 2.8} diff --git a/tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch b/tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch new file mode 100644 index 0000000..615f49b --- /dev/null +++ b/tests-test_fileio.py-don-t-follow-symlinks-in-dev.patch @@ -0,0 +1,33 @@ +From: Jiri Slaby +Date: Thu, 2 Nov 2023 11:37:44 +0100 +Subject: tests: test_fileio.py: don't follow symlinks in /dev +Patch-mainline: submitted https://github.com/agronholm/anyio/pull/626 +References: fix for kernel 6.6 + +There might be a broken one like /dev/log and this causes the tests to +fail. + +This is highly is unpredictable, because os.scandir() sometimes returns +a block device, sometimes the broken link is hit. + +So pass follow_symlinks=False to entry.stat(). +--- + tests/test_fileio.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_fileio.py b/tests/test_fileio.py +index 9e6b2a8325..c4801187db 100644 +--- a/tests/test_fileio.py ++++ b/tests/test_fileio.py +@@ -218,7 +218,7 @@ class TestPath: + assert not await Path("/btelkbee").is_block_device() + with os.scandir("/dev") as iterator: + for entry in iterator: +- if stat.S_ISBLK(entry.stat().st_mode): ++ if stat.S_ISBLK(entry.stat(follow_symlinks=False).st_mode): + assert await Path(entry.path).is_block_device() + break + else: +-- +2.42.0 +