From e60fbf1be7fc21c33c6447bd28f01146712c4a60 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 20 Jul 2026 10:35:05 +0300 Subject: [PATCH 1/3] gh-154226: Fix test_posix_pty_functions on Solaris Co-Authored-By: Claude Fable 5 --- Lib/test/test_os/test_os.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_os/test_os.py b/Lib/test/test_os/test_os.py index 5c258ff89ba735c..41928b308c47799 100644 --- a/Lib/test/test_os/test_os.py +++ b/Lib/test/test_os/test_os.py @@ -4727,6 +4727,13 @@ def test_posix_pty_functions(self): son_path = os.ptsname(mother_fd) son_fd = os.open(son_path, os.O_RDWR|os.O_NOCTTY) self.addCleanup(os.close, son_fd) + if sys.platform.startswith('sunos'): + # The slave is not a terminal until these STREAMS modules + # are pushed onto it. + import fcntl + I_PUSH = 0x5302 + fcntl.ioctl(son_fd, I_PUSH, b'ptem\0') + fcntl.ioctl(son_fd, I_PUSH, b'ldterm\0') self.assertEqual(os.ptsname(mother_fd), os.ttyname(son_fd)) @warnings_helper.ignore_fork_in_thread_deprecation_warnings() From 28a60e81ebad1fa7e257eaa3c67bb67f1927d97a Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 20 Jul 2026 11:18:22 +0300 Subject: [PATCH 2/3] Add a NEWS entry --- .../next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst diff --git a/Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst b/Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst new file mode 100644 index 000000000000000..586f82e623bffe8 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst @@ -0,0 +1,2 @@ +Fix ``test_posix_pty_functions`` in :mod:`!test.test_os` on Solaris +and illumos. From 99425210257bdfc89bb146bcec7cd27f8d60b76f Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 20 Jul 2026 11:20:48 +0300 Subject: [PATCH 3/3] Remove the NEWS entry --- .../next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst diff --git a/Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst b/Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst deleted file mode 100644 index 586f82e623bffe8..000000000000000 --- a/Misc/NEWS.d/next/Tests/2026-07-20-14-05-00.gh-issue-154226.ptytest.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix ``test_posix_pty_functions`` in :mod:`!test.test_os` on Solaris -and illumos.