By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,035 Members | 1,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,035 IT Pros & Developers. It's quick & easy.

pexpect/termios error: Inappropriate ioctl for device

P: n/a
Hi All,

I have a python program that downloads database backups from a remote server, and tries to replace the local database with the downloaded backup. The database is a PostgreSQL server and my program calls the pg_restore command with the aid of the wonderful pexpect module. Everything works fine if I start this program from a tty. When I try to start the same program from cron, I get this nasty exception:

Traceback (most recent call last):
File "/root/", line 82, in ?
File "/root/", line 79, in main
File "/root/", line 73, in restore_all
File "/root/", line 56, in do_restore
File "/root/", line 44, in dropdb
File "/usr/local/lib/python2.4/site-packages/", line 1226, in interact
mode = tty.tcgetattr(self.STDIN_FILENO)
termios.error: (25, 'Inappropriate ioctl for device')

What can I do to avoid this?


May 31 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.