Menu

#33 pexpect timeout disable does not function properly fo run()

v1.0 (example)
closed-invalid
nobody
None
5
2014-06-03
2011-06-15
Ian
No

form line 218:
if timeout == -1:
child = spawn(command, maxread=2000, logfile=logfile, cwd=cwd, env=env)
else:
child = spawn(command, timeout=timeout, maxread=2000, logfile=logfile, cwd=cwd, env=env)
line 219 should be:
child = spawn(command, maxread=2000, timeout=-1 logfile=logfile, cwd=cwd, env=env)
or simply take out the if else block altogether and pass timeout along to spawn
because:
class spawn (object):

"""This is the main class interface for Pexpect. Use this class to start
and control child applications. """

def __init__(self, command, args=[], timeout=30, maxread=2000, searchwindowsize=None, logfile=None, cwd=None, env=None):

If you specify timeout=-1 you get timeout = 30

Discussion

  • Thomas Kluyver

    Thomas Kluyver - 2014-06-03
    • status: open --> closed-invalid
    • Group: --> v1.0 (example)
     
  • Thomas Kluyver

    Thomas Kluyver - 2014-06-03

    The convention in Pexpect is that timeout=-1 tells it to inherit a default timeout, and timeout=None means no timeout. If you think there's still an issue, please report it on Github. https://github.com/pexpect/pexpect/pull/62

     

Log in to post a comment.