[3.13] gh-154226: Fix test_posix_pty_functions on Solaris (GH-154230) (GH-154243)

serhiy-storchaka <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/5f74b9e1c01c522f452e8ca7653d5b424136880b
commit: 5f74b9e1c01c522f452e8ca7653d5b424136880b
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-20T12:35:50+03:00
summary:

[3.13] gh-154226: Fix test_posix_pty_functions on Solaris (GH-154230) (GH-154243)

(cherry picked from commit 3d998611a48b45691894c687ac0ec52b54df52bf)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>

files:
M Lib/test/test_os.py

diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 88b215be49c5ca..50f6b09b1ee4cc 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -4788,6 +4788,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))
 
     @unittest.skipUnless(hasattr(os, 'spawnl'), "need os.spawnl()")

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.