win32: Pipes opened with popen3 cant be closed!

Nahuel Greco ngreco at softhome.net
Tue Mar 27 10:30:32 EST 2001


Hi, im doing the following thing in Windows 98 / Activestate Python 2.0:

	import win32pipe

	cmd = "c:\\zebedee\\zebedee.exe -d 127.0.0.1"
	pipes = win32pipe.popen3(cmd,'t')

	#Now.. if i do:

	pipes[0].close()
	pipes[1].close()
	pipes[2].close()  # in this line, the program hangs.


If i follow another closing order, the program stills hangs in the last
close() call .. i think that when all the pipes are closed.. win32pipe
try to close the child program.. and wait for that close.. but, the
child program never exit.

If i do not close the pipes, when my python script exits, the child
program is still running (i dont want that).

The zebedee.exe that im using is at  
http://www.winton.org.uk/zebedee/download.html

Zebedee.exe is a program that doesnt exit inmediatly, it wait for
tcp connections, and print the conections made to stderr (using -d
"detach" flag). You can emulate it with:


	import time
	import sys
 
	while 1:
		sys.stderr.write("hello\n")
		sys.stderr.flush()
		time.sleep(1)
 


Im dont use win32 usually.. im lost in the Gates dimension :).


_------------------------------------------------------------.
| Nahuel Greco                 Web Development - Open Source |
| http://www.codelarvs.com.ar  Game Programming - Research   |
| Freelance coding / sysadmin  Networking. The answer is 42. |
'------------------------------------------------------------'






More information about the Python-list mailing list