Adrian Casey <[EMAIL PROTECTED]> wrote: > I'm running Kubuntu 06-06 with python 2.4.3 and the above code runs forever > at 100% cpu utilization.
Interesting... I wonder if that is a fixed bug. On Debian/etch with python-pexpect 2.1-1 I get Python 2.4.4c0 (#2, Jul 30 2006, 15:43:58) [GCC 4.1.2 20060715 (prerelease) (Debian 4.1.1-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os, pexpect, threading >>> def runyes(): ... print "Running yes command..." ... pexpect.run('yes', timeout=5) ... >>> t = threading.Thread(target=runyes) >>> t.start() >>> Running yes command... t.join() >>> Wheras on Ubuntu/dapper with python-pexpect 0.999-5ubuntu2 I get Python 2.4.3 (#2, Apr 27 2006, 14:43:58) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os, pexpect, threading >>> def runyes(): ... print "Running yes command..." ... pexpect.run('yes', timeout=5) ... >>> t = threading.Thread(target=runyes) >>> t.start() >>> Running yes command... t.join() [never returns] I'd guess at differences between the pexpect versions. You could try the pexpect from debian/testing easily enough I expect. -- Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list