become_tty_fg exception if no TTY available

#1 · closed · 4 comments

View on GitHub ↗

davidswelt

Unfortunately, the become_tty_fg causes this script to error out when no TTY is available (cronjob): command is ['rsync', '--partial', '--progress', '--rsh=ssh', '--timeout=5', '-l', '-r', 'builds', 'xxxxx24/'] Traceback (most recent call last): File "/Users/xxxxx/retry.py", line 69, in <module> preexec_fn=become_tty_fg) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 524, in call return Popen(_popenargs, *_kwargs).wait() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in **init** errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child raise child_exception OSError: [Errno 6] Device not configured: '/dev/tty'

Comments

stsquad

Interesting test case. I would be wary using cron without some sort of limit though as it could sit there for some time.

stsquad

@davidswelt hows that work for you?

stsquad

@davidswelt hi David, can I close this issue now?

davidswelt

Looks good to me! > On Oct 6, 2015, at 4:39 AM, Alex Bennée [email protected] wrote: > > @davidswelt hi David, can I close this issue now? > > — > Reply to this email directly or view it on GitHub.