]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-154226: Fix test_posix_pty_functions on Solaris (GH-154230) (GH-154242)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 20 Jul 2026 09:36:03 +0000 (11:36 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2026 09:36:03 +0000 (12:36 +0300)
(cherry picked from commit 3d998611a48b45691894c687ac0ec52b54df52bf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Lib/test/test_os.py

index 8e6cc8f056f128bd0f24da2ee9a31426c055f0cf..48b925ad9b2244b35c936cbc135e7d611413b6a8 100644 (file)
@@ -4954,6 +4954,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))
 
     @unittest.skipUnless(hasattr(os, 'spawnl'), "need os.spawnl()")