Hrvoje Niksic wrote:
> 
> OK, here is another interesting problem which took several hours to
> track.  When a Gtk program forks off, it inherits the X file
> descriptors from its parent.  It seems that when I call sys.exit(),
> Gdk gains control (either through atexit() or through a PyGtk cleanup
> intercepting SystemExit), interacts with the X file descriptors,
> totally hosing the parent.  As a result, the parent's Gdk reports IO
> errors and aborts.

Oops, I meant to warn you about this. :(

>From the child process, I avoid sys.exit like the plague.  Rather, I do 

os.execv("/bin/true",[])

The execv simply replaces the current process with /bin/true, which
exits nicely, leaving the parent's file descriptors alone.


-- 
Richard Fish                      Enhanced Software Technologies, Inc.
Software Developer                4014 E Broadway Rd Suite 405
[EMAIL PROTECTED]                    Phoenix, AZ  85040 
(602) 470-1115                    http://www.estinc.com
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to