python expect, pexpect, from inside solaris cron
Small issue: solaris cron doesn’t set up much of an environment, and /dev/tty won’t show up.
The bug:
Traceback (most recent call last):
File "test/pex.py", line 2, in
child = pexpect.spawn ('ftp ftp.openbsd.org')
File "/pkg/lib/python2.5/site-packages/pexpect.py", line 429, in __init__
self._spawn (command, args)
File "/pkg/lib/python2.5/site-packages/pexpect.py", line 531, in _spawn
self.pid, self.child_fd = self.__fork_pty()
File "/pkg/lib/python2.5/site-packages/pexpect.py", line 592, in __fork_pty
self.__pty_make_controlling_tty(child_fd)
File "/pkg/lib/python2.5/site-packages/pexpect.py", line 615, in __pty_make_controlling_tty
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY);
The fix: http://ioctl.org/unix/pexpect.diff
..which I’ll pass upstream.