Title: Telnetlib.expect crashes when a timeout parameter is given.
Type: Severity: normal
Components: Library Versions: 2.2.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amak Nosy List: amak
Priority: Keywords:

Created on 2008-12-18.17:02:20 by amak, last changed 2008-12-18.20:15:37 by amak.

msg3961 (view) Author: Alan Kennedy (amak) Date: 2008-12-18.17:02:19
Recording a bug to track an issue reported by Shaman Mahmoudi to

From Shaman's email.

I am using the latest stable version of jython, version 2.2.1 and I am
trying to write a simple telnet program. However, I am having an issue with
the expect method in it.

Here is my code:

import telnetlib

HOST = 'localhost'
user = 'someone'
password = 'someones password'

tn = telnetlib.Telnet(HOST, 22)

aa, bb, cc = tn.expect(['>>>'], 1)

print aa
print bb
print cc

And this is the error message:

Traceback (innermost last):
 File "/home/qm/workspace/project000/", line 11, in ?
 File "/home/qm/jython/Lib/", line 623, in expect
 File "/home/qm/jython/Lib/", line 204, in
 File "/home/qm/jython/Lib/", line 54, in _getselectable
TypeError: ("Object 'java.nio.channels.SocketChannel[connected
local=/ remote=/]' is not watchable", 88)
msg3962 (view) Author: Alan Kennedy (amak) Date: 2008-12-18.20:15:37
This bug was caused by failure of _getselectable() function in the 2.2
select module to recognise that it had already been passed a
SelectableChannel. Fixed in r5777.

This bug does not occur in 2.5; still I added an explicit check to
ensure that this is so.
Date User Action Args
2008-12-18 20:15:37amaksetstatus: open -> closed
resolution: fixed
messages: + msg3962
2008-12-18 17:02:20amakcreate