This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Joel.Lovinger
Recipients Joel.Lovinger, jackdied, r.david.murray
Date 2012-04-12.18:55:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334256930.53.0.352189299659.issue14556@psf.upfronthosting.co.za>
In-reply-to
Content
2.4 behavior, "time out if there is no more data for X seconds", only worked as expected in the case of timeout=0. Any other timeout could result in indefinite extension and needed fixing.

2.7 behavior, "time out if there is no match for X seconds" fixes timeout!=0 cases while breaking for timeout=0.

Can't get former behavior on timeout=0 in 2.7 using socket.settimeout(). Call to socket.recv() then throws a timeout exception which isn't caught by Telnet.expect.

I think fixing timeout=0 will require a patch to Telnet.expect. The simplest would likely be to insert a "very eager" type read to grab all data without blocking before entering the match loop. Won't need to modify existing timeout logic and sidesteps any new corner cases on select/recv iteration.

The only functional side effect (other than moving storage in some cases from the socket to the Telnet object) is on greedy RE that will have more data to match. Documentation already warns against greedy RE as non-deterministic so hopefully not an issue.
History
Date User Action Args
2012-04-12 18:55:30Joel.Lovingersetrecipients: + Joel.Lovinger, jackdied, r.david.murray
2012-04-12 18:55:30Joel.Lovingersetmessageid: <1334256930.53.0.352189299659.issue14556@psf.upfronthosting.co.za>
2012-04-12 18:55:29Joel.Lovingerlinkissue14556 messages
2012-04-12 18:55:29Joel.Lovingercreate