classification
Title: telnetlib SyntaxError: invalid syntax
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Mark McDonnell, SilentGhost, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-12-29 15:18 by Mark McDonnell, last changed 2015-12-29 15:20 by SilentGhost. This issue is now closed.

Messages (2)
msg257193 - (view) Author: Mark McDonnell (Mark McDonnell) Date: 2015-12-29 15:18
I'm trying to use telnetlib in a simple script similar to the example show in the documentation. I get an error saying SyntaxError: invalid syntax. This is true with Windows 10, and XP, both using Python 2.7.11 32 bit.

Here's what happens in IDLE:
>>> import sys
>>> import telnetlib
>>> tn = telnetlib.Telnet(host=192.168.1.15, port=3490, timeout=5)
SyntaxError: invalid syntax
>>> tn = telnetlib.Telnet(192.168.1.15, 3490, 5)
SyntaxError: invalid syntax
>>> tn = telnetlib.Telnet(192.168.1.15)
SyntaxError: invalid syntax
>>> tn = telnetlib.Telnet(host=192.168.1.15, port=3490, timeout=5)
msg257194 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-12-29 15:20
The host ip needs to be supplied as a string:

telnetlib.Telnet(host='192.168.1.15', port=3490, timeout=5)
History
Date User Action Args
2015-12-29 15:20:21SilentGhostsetstatus: open -> closed

type: behavior

nosy: + SilentGhost
messages: + msg257194
resolution: not a bug
stage: resolved
2015-12-29 15:18:00Mark McDonnellcreate