rexpect icon indicating copy to clipboard operation
rexpect copied to clipboard

Timeout behavior is not the same as pexpect

Open yancyribbens opened this issue 1 year ago • 1 comments

pexpect will eventually raise a timeout:

If nothing matches an expected pattern then expect() will eventually raise a TIMEOUT exception. The default time is 30 seconds, but you can change this by passing a timeout argument to expect():

It looks like rexpect does not timeout but hangs forever.

yancyribbens avatar May 01 '24 03:05 yancyribbens

Is there a way to make rexpect timeout in some way like pexpect?

yancyribbens avatar May 01 '24 03:05 yancyribbens

@yancyribbens: From the docs of spawn:

timeout: If Some: all exp_* commands time out after x milliseconds, if None: never times out. It’s highly recommended to put a timeout there, as otherwise in case of a problem the program just hangs instead of exiting with an error message indicating where it stopped. For automation 30’000 (30s, the default in pexpect) is a good value.

d4h0 avatar May 10 '24 10:05 d4h0

that works

yancyribbens avatar May 13 '24 21:05 yancyribbens