I'm creating a pseudo terminal pair in Python, on Mac OS, and then trying to get their names.
import os
import pty
master, slave = pty.openpty()
print(os.ttyname(slave))
print(os.ttyname(master))
I can get the slave one but Python crashes when trying to get the master one.
$ python --version
Python 3.9.10
$ python shim/tunnel.py
/dev/ttys009
Traceback (most recent call last):
File "/Users/tamlyn/projects/shim/tunnel.py", line 7, in <module>
print(os.ttyname(master))
OSError: [Errno 34] Result too large
Why is this happening?