| Store | Cart

popen from inside a thread not working!

From: Steve <nos...@nopes.com>
Thu, 11 Mar 2004 19:57:14 +1100

I have a couple of threads running in my program and I tried to do the 
following from one thread:

out = os.popen("su -l postgres -c \"psql -c 'VACUUM ANALYZE table1' -d 

This gives me the following error:

standard in must be a tty

No matter what I do, it doesn't work. I tried os.system(), os.popen2() 
etc but nothing works. Please tell me what to do! I also tried writing a 
small shell script and then calling that script from popen() but I still 
get the same error. If I try this from the main program, i.e the point 
at which I create run the threads, it works! I want the threads to be 
doing this and not the main script so please help. Thanks,


Recent Messages in this Thread
Steve Mar 11, 2004 08:57 am
Jeff Epler Mar 11, 2004 02:34 pm
Messages in this thread