From b05ed78a8a97208c862b004ced8bfc824838e9d3 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:36:17 +0200 Subject: [PATCH] [3.15] gh-154226: Fix test_posix_pty_functions on Solaris (GH-154230) (GH-154241) (cherry picked from commit 3d998611a48b45691894c687ac0ec52b54df52bf) Co-authored-by: Serhiy Storchaka 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 279c9ac804f6..f2b9cf75d3bf 100644 --- a/Lib/test/test_os/test_os.py +++ b/Lib/test/test_os/test_os.py @@ -4715,6 +4715,13 @@ class PseudoterminalTests(unittest.TestCase): 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() -- 2.47.3