[Tutor] REG : Pexpect timeout issue

Cameron Simpson cs at cskk.id.au
Sat Sep 1 20:01:02 EDT 2018


On 02Sep2018 00:31, Steven D'Aprano <steve at pearwood.info> wrote:
>On Sat, Sep 01, 2018 at 11:41:42AM +0000, krishna chaitanya via Tutor wrote:
>> Below is my code, i am frequently hitting timeout issue to login to linux or 
>> router.
>
>Timeout issues are a network problem. Perhaps your network is too busy,
>or the cable is faulty, or your router is being hammered by attackers
>and can't respond.

No, timeout issues are "the target input didn't arrive in this timeframe".

All his commands are _local_.

Krishna: if you're blocking waiting for a pattern (eg "Password:") and it times 
out, even for big timeouts, then maybe the pattern is wrong. A command like 
"su" will prompt for a password and then wait indefinitely. If your prompt 
pattern is incorrect, you will wait indefinitely waiting for the pattern to 
show up, because it never will.

Run an interactive "su" and see if it matches your pattern.

And so on.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Tutor mailing list