From: Hal Fulton Date: 2004-06-24T05:29:25+09:00 Subject: Re: PTY.spawn error-prone? Ben Giddings wrote: > Hal Fulton wrote: > >> I've been playing with PTY and it seems to me that this >> implementation is exceptionally prone to errors. >> >> Can anyone comment? I'm not knowledgeable of the implementation >> details, but I plan to look at it now. > > > What kind of errors? Exceptions, like the child exiting, and the fun > related to that, or real bug-type errors? The former, I suppose. Isn't it the case that the child may exit for a variety of reasons? And doesn't this exception sometimes occur for no apparent reason at all? Forgive my ignorance. Only part of this is based on experience. Allow me to quote from the rexpect docs on rubyforge: > 19 # > 20 # Suppose you tell it to spawn off a command that doesn't exist.... > 21 # What do you think will happen? > 22 # 1) You get a sane error code? > 23 # 2) It raises an appropriate Exception? > 24 # 3) Returns quite happily and at some random time later, throws a > 25 # PTY::ChildExited exception? > 26 # > 27 # Yup. Option 3) is what happens. > 28 # Evil isn't it?! Well, that doesn't sound *so* bad... but I would swear that sometimes it is crapping out for no reason at all. (Yeah, I know, "select isn't broken" -- thanks, Dave.) I'll investigate more. If anyone has knowledge, please chime in. Thanks, Hal