473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

pexpect/termios error: Inappropriate ioctl for device

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/restore_databases.py", line 82, in ?
main()
File "/root/restore_databases.py", line 79, in main
restore_all()
File "/root/restore_databases.py", line 73, in restore_all
do_restore(os.path.join(BACKUPDIR,fname),database)
File "/root/restore_databases.py", line 56, in do_restore
dropdb(database)
File "/root/restore_databases.py", line 44, in dropdb
db.interact()
File "/usr/local/lib/python2.4/site-packages/pexpect.py", line 1226, in interact
mode = tty.tcgetattr(self.STDIN_FILENO)
termios.error: (25, 'Inappropriate ioctl for device')

What can I do to avoid this?

Thanks,

Laszlo
May 31 '07 #1
0 2310

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Javier | last post by:
Hi all!! I'm trying to use Python to help in testing software for the Windows Platform. The sw we develop at the company I work for sets up quite a number of "new" device drives in Windows,...
2
by: Chris Johnson | last post by:
I have need to determine the capabilities of an optical drive. Right now I'm using SDL to find the drives, and ioctl to get the capabilities. Unfortunately, based on the output that I'm getting,...
6
by: Eran.Yasso | last post by:
Hi all, I need to write a GUI app which do the followings: 1. My app waits for events from other app(actually this is a network adapter driver) running in kernel. The driver writes to file and...
1
by: Kevin Erickson | last post by:
Hello, I am attempting to use pexpect in python to copy files from a server using scp; the copy works however exceptions are thrown and it exits unsuccessfully. Below is the a sample code and...
4
by: indianteam | last post by:
I am trying to write a multi-threaded program and use pexpect along with it. All works fine until I try to close the connection handle. That thread keeps waiting until the connection handle closes....
0
by: Vishal Sethia | last post by:
I am trying to write a multi-threaded program and use pexpect along with it. All works fine until I try to close the connection handle. That thread keeps waiting until the connection handle closes....
0
by: bsdixon21222 | last post by:
Hello All, I havn't been programming with python too long, but decided the best way to learn it would be to dive right in. Right now I have been taking snippets here and there along with...
2
by: Brice Rebsamen | last post by:
Hi I wrote the following program that reads the keyboard in medium raw mode (keycode mode). Here is the initialization code, the full code is at the end. fd = open("/dev/tty0", O_RDONLY);...
1
by: Sriram Rajan | last post by:
For some reason, Using pexpect causes my output to echo twice when I connect from my MAC Darwin (10.4) to Linux (CentOS release 5 ): The program: --------------------- #!/usr/bin/python #...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.