Back
Type Name Operations
__future__.cpython-36.opt-1.pyc
__future__.cpython-36.opt-2.pyc
__future__.cpython-36.pyc
__phello__.foo.cpython-36.opt-1.pyc
__phello__.foo.cpython-36.opt-2.pyc
__phello__.foo.cpython-36.pyc
_bootlocale.cpython-36.opt-1.pyc
_bootlocale.cpython-36.opt-2.pyc
_bootlocale.cpython-36.pyc
_collections_abc.cpython-36.opt-1.pyc
_collections_abc.cpython-36.opt-2.pyc
_collections_abc.cpython-36.pyc
_compat_pickle.cpython-36.opt-1.pyc
_compat_pickle.cpython-36.opt-2.pyc
_compat_pickle.cpython-36.pyc
_compression.cpython-36.opt-1.pyc
_compression.cpython-36.opt-2.pyc
_compression.cpython-36.pyc
_dummy_thread.cpython-36.opt-1.pyc
_dummy_thread.cpython-36.opt-2.pyc
_dummy_thread.cpython-36.pyc
_markupbase.cpython-36.opt-1.pyc
_markupbase.cpython-36.opt-2.pyc
_markupbase.cpython-36.pyc
_osx_support.cpython-36.opt-1.pyc
_osx_support.cpython-36.opt-2.pyc
_osx_support.cpython-36.pyc
_pydecimal.cpython-36.opt-1.pyc
_pydecimal.cpython-36.opt-2.pyc
_pydecimal.cpython-36.pyc
_pyio.cpython-36.opt-1.pyc
_pyio.cpython-36.opt-2.pyc
_pyio.cpython-36.pyc
_sitebuiltins.cpython-36.opt-1.pyc
_sitebuiltins.cpython-36.opt-2.pyc
_sitebuiltins.cpython-36.pyc
_strptime.cpython-36.opt-1.pyc
_strptime.cpython-36.opt-2.pyc
_strptime.cpython-36.pyc
_sysconfigdata_dm_linux_x86_64-linux-gnu.cpython-36.opt-1.pyc
_sysconfigdata_dm_linux_x86_64-linux-gnu.cpython-36.opt-2.pyc
_sysconfigdata_dm_linux_x86_64-linux-gnu.cpython-36.pyc
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.opt-1.pyc
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.opt-2.pyc
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc
_threading_local.cpython-36.opt-1.pyc
_threading_local.cpython-36.opt-2.pyc
_threading_local.cpython-36.pyc
_weakrefset.cpython-36.opt-1.pyc
_weakrefset.cpython-36.opt-2.pyc
_weakrefset.cpython-36.pyc
abc.cpython-36.opt-1.pyc
abc.cpython-36.opt-2.pyc
abc.cpython-36.pyc
aifc.cpython-36.opt-1.pyc
aifc.cpython-36.opt-2.pyc
aifc.cpython-36.pyc
antigravity.cpython-36.opt-1.pyc
antigravity.cpython-36.opt-2.pyc
antigravity.cpython-36.pyc
argparse.cpython-36.opt-1.pyc
argparse.cpython-36.opt-2.pyc
argparse.cpython-36.pyc
ast.cpython-36.opt-1.pyc
ast.cpython-36.opt-2.pyc
ast.cpython-36.pyc
asynchat.cpython-36.opt-1.pyc
asynchat.cpython-36.opt-2.pyc
asynchat.cpython-36.pyc
asyncore.cpython-36.opt-1.pyc
asyncore.cpython-36.opt-2.pyc
asyncore.cpython-36.pyc
base64.cpython-36.opt-1.pyc
base64.cpython-36.opt-2.pyc
base64.cpython-36.pyc
bdb.cpython-36.opt-1.pyc
bdb.cpython-36.opt-2.pyc
bdb.cpython-36.pyc
binhex.cpython-36.opt-1.pyc
binhex.cpython-36.opt-2.pyc
binhex.cpython-36.pyc
bisect.cpython-36.opt-1.pyc
bisect.cpython-36.opt-2.pyc
bisect.cpython-36.pyc
bz2.cpython-36.opt-1.pyc
bz2.cpython-36.opt-2.pyc
bz2.cpython-36.pyc
cProfile.cpython-36.opt-1.pyc
cProfile.cpython-36.opt-2.pyc
cProfile.cpython-36.pyc
calendar.cpython-36.opt-1.pyc
calendar.cpython-36.opt-2.pyc
calendar.cpython-36.pyc
cgi.cpython-36.opt-1.pyc
cgi.cpython-36.opt-2.pyc
cgi.cpython-36.pyc
cgitb.cpython-36.opt-1.pyc
cgitb.cpython-36.opt-2.pyc
cgitb.cpython-36.pyc
chunk.cpython-36.opt-1.pyc
chunk.cpython-36.opt-2.pyc
chunk.cpython-36.pyc
cmd.cpython-36.opt-1.pyc
cmd.cpython-36.opt-2.pyc
cmd.cpython-36.pyc
code.cpython-36.opt-1.pyc
code.cpython-36.opt-2.pyc
code.cpython-36.pyc
codecs.cpython-36.opt-1.pyc
codecs.cpython-36.opt-2.pyc
codecs.cpython-36.pyc
codeop.cpython-36.opt-1.pyc
codeop.cpython-36.opt-2.pyc
codeop.cpython-36.pyc
colorsys.cpython-36.opt-1.pyc
colorsys.cpython-36.opt-2.pyc
colorsys.cpython-36.pyc
compileall.cpython-36.opt-1.pyc
compileall.cpython-36.opt-2.pyc
compileall.cpython-36.pyc
configparser.cpython-36.opt-1.pyc
configparser.cpython-36.opt-2.pyc
configparser.cpython-36.pyc
contextlib.cpython-36.opt-1.pyc
contextlib.cpython-36.opt-2.pyc
contextlib.cpython-36.pyc
copy.cpython-36.opt-1.pyc
copy.cpython-36.opt-2.pyc
copy.cpython-36.pyc
copyreg.cpython-36.opt-1.pyc
copyreg.cpython-36.opt-2.pyc
copyreg.cpython-36.pyc
crypt.cpython-36.opt-1.pyc
crypt.cpython-36.opt-2.pyc
crypt.cpython-36.pyc
csv.cpython-36.opt-1.pyc
csv.cpython-36.opt-2.pyc
csv.cpython-36.pyc
datetime.cpython-36.opt-1.pyc
datetime.cpython-36.opt-2.pyc
datetime.cpython-36.pyc
decimal.cpython-36.opt-1.pyc
decimal.cpython-36.opt-2.pyc
decimal.cpython-36.pyc
difflib.cpython-36.opt-1.pyc
difflib.cpython-36.opt-2.pyc
difflib.cpython-36.pyc
dis.cpython-36.opt-1.pyc
dis.cpython-36.opt-2.pyc
dis.cpython-36.pyc
doctest.cpython-36.opt-1.pyc
doctest.cpython-36.opt-2.pyc
doctest.cpython-36.pyc
dummy_threading.cpython-36.opt-1.pyc
dummy_threading.cpython-36.opt-2.pyc
dummy_threading.cpython-36.pyc
enum.cpython-36.opt-1.pyc
enum.cpython-36.opt-2.pyc
enum.cpython-36.pyc
filecmp.cpython-36.opt-1.pyc
filecmp.cpython-36.opt-2.pyc
filecmp.cpython-36.pyc
fileinput.cpython-36.opt-1.pyc
fileinput.cpython-36.opt-2.pyc
fileinput.cpython-36.pyc
fnmatch.cpython-36.opt-1.pyc
fnmatch.cpython-36.opt-2.pyc
fnmatch.cpython-36.pyc
formatter.cpython-36.opt-1.pyc
formatter.cpython-36.opt-2.pyc
formatter.cpython-36.pyc
fractions.cpython-36.opt-1.pyc
fractions.cpython-36.opt-2.pyc
fractions.cpython-36.pyc
ftplib.cpython-36.opt-1.pyc
ftplib.cpython-36.opt-2.pyc
ftplib.cpython-36.pyc
functools.cpython-36.opt-1.pyc
functools.cpython-36.opt-2.pyc
functools.cpython-36.pyc
genericpath.cpython-36.opt-1.pyc
genericpath.cpython-36.opt-2.pyc
genericpath.cpython-36.pyc
getopt.cpython-36.opt-1.pyc
getopt.cpython-36.opt-2.pyc
getopt.cpython-36.pyc
getpass.cpython-36.opt-1.pyc
getpass.cpython-36.opt-2.pyc
getpass.cpython-36.pyc
gettext.cpython-36.opt-1.pyc
gettext.cpython-36.opt-2.pyc
gettext.cpython-36.pyc
glob.cpython-36.opt-1.pyc
glob.cpython-36.opt-2.pyc
glob.cpython-36.pyc
gzip.cpython-36.opt-1.pyc
gzip.cpython-36.opt-2.pyc
gzip.cpython-36.pyc
hashlib.cpython-36.opt-1.pyc
hashlib.cpython-36.opt-2.pyc
hashlib.cpython-36.pyc
heapq.cpython-36.opt-1.pyc
heapq.cpython-36.opt-2.pyc
heapq.cpython-36.pyc
hmac.cpython-36.opt-1.pyc
hmac.cpython-36.opt-2.pyc
hmac.cpython-36.pyc
imaplib.cpython-36.opt-1.pyc
imaplib.cpython-36.opt-2.pyc
imaplib.cpython-36.pyc
imghdr.cpython-36.opt-1.pyc
imghdr.cpython-36.opt-2.pyc
imghdr.cpython-36.pyc
imp.cpython-36.opt-1.pyc
imp.cpython-36.opt-2.pyc
imp.cpython-36.pyc
inspect.cpython-36.opt-1.pyc
inspect.cpython-36.opt-2.pyc
inspect.cpython-36.pyc
io.cpython-36.opt-1.pyc
io.cpython-36.opt-2.pyc
io.cpython-36.pyc
ipaddress.cpython-36.opt-1.pyc
ipaddress.cpython-36.opt-2.pyc
ipaddress.cpython-36.pyc
keyword.cpython-36.opt-1.pyc
keyword.cpython-36.opt-2.pyc
keyword.cpython-36.pyc
linecache.cpython-36.opt-1.pyc
linecache.cpython-36.opt-2.pyc
linecache.cpython-36.pyc
locale.cpython-36.opt-1.pyc
locale.cpython-36.opt-2.pyc
locale.cpython-36.pyc
lzma.cpython-36.opt-1.pyc
lzma.cpython-36.opt-2.pyc
lzma.cpython-36.pyc
macpath.cpython-36.opt-1.pyc
macpath.cpython-36.opt-2.pyc
macpath.cpython-36.pyc
macurl2path.cpython-36.opt-1.pyc
macurl2path.cpython-36.opt-2.pyc
macurl2path.cpython-36.pyc
mailbox.cpython-36.opt-1.pyc
mailbox.cpython-36.opt-2.pyc
mailbox.cpython-36.pyc
mailcap.cpython-36.opt-1.pyc
mailcap.cpython-36.opt-2.pyc
mailcap.cpython-36.pyc
mimetypes.cpython-36.opt-1.pyc
mimetypes.cpython-36.opt-2.pyc
mimetypes.cpython-36.pyc
modulefinder.cpython-36.opt-1.pyc
modulefinder.cpython-36.opt-2.pyc
modulefinder.cpython-36.pyc
netrc.cpython-36.opt-1.pyc
netrc.cpython-36.opt-2.pyc
netrc.cpython-36.pyc
nntplib.cpython-36.opt-1.pyc
nntplib.cpython-36.opt-2.pyc
nntplib.cpython-36.pyc
ntpath.cpython-36.opt-1.pyc
ntpath.cpython-36.opt-2.pyc
ntpath.cpython-36.pyc
nturl2path.cpython-36.opt-1.pyc
nturl2path.cpython-36.opt-2.pyc
nturl2path.cpython-36.pyc
numbers.cpython-36.opt-1.pyc
numbers.cpython-36.opt-2.pyc
numbers.cpython-36.pyc
opcode.cpython-36.opt-1.pyc
opcode.cpython-36.opt-2.pyc
opcode.cpython-36.pyc
operator.cpython-36.opt-1.pyc
operator.cpython-36.opt-2.pyc
operator.cpython-36.pyc
optparse.cpython-36.opt-1.pyc
optparse.cpython-36.opt-2.pyc
optparse.cpython-36.pyc
os.cpython-36.opt-1.pyc
os.cpython-36.opt-2.pyc
os.cpython-36.pyc
pathlib.cpython-36.opt-1.pyc
pathlib.cpython-36.opt-2.pyc
pathlib.cpython-36.pyc
pdb.cpython-36.opt-1.pyc
pdb.cpython-36.opt-2.pyc
pdb.cpython-36.pyc
pickle.cpython-36.opt-1.pyc
pickle.cpython-36.opt-2.pyc
pickle.cpython-36.pyc
pickletools.cpython-36.opt-1.pyc
pickletools.cpython-36.opt-2.pyc
pickletools.cpython-36.pyc
pipes.cpython-36.opt-1.pyc
pipes.cpython-36.opt-2.pyc
pipes.cpython-36.pyc
pkgutil.cpython-36.opt-1.pyc
pkgutil.cpython-36.opt-2.pyc
pkgutil.cpython-36.pyc
platform.cpython-36.opt-1.pyc
platform.cpython-36.opt-2.pyc
platform.cpython-36.pyc
plistlib.cpython-36.opt-1.pyc
plistlib.cpython-36.opt-2.pyc
plistlib.cpython-36.pyc
poplib.cpython-36.opt-1.pyc
poplib.cpython-36.opt-2.pyc
poplib.cpython-36.pyc
posixpath.cpython-36.opt-1.pyc
posixpath.cpython-36.opt-2.pyc
posixpath.cpython-36.pyc
pprint.cpython-36.opt-1.pyc
pprint.cpython-36.opt-2.pyc
pprint.cpython-36.pyc
profile.cpython-36.opt-1.pyc
profile.cpython-36.opt-2.pyc
profile.cpython-36.pyc
pstats.cpython-36.opt-1.pyc
pstats.cpython-36.opt-2.pyc
pstats.cpython-36.pyc
pty.cpython-36.opt-1.pyc
pty.cpython-36.opt-2.pyc
pty.cpython-36.pyc
py_compile.cpython-36.opt-1.pyc
py_compile.cpython-36.opt-2.pyc
py_compile.cpython-36.pyc
pyclbr.cpython-36.opt-1.pyc
pyclbr.cpython-36.opt-2.pyc
pyclbr.cpython-36.pyc
pydoc.cpython-36.opt-1.pyc
pydoc.cpython-36.opt-2.pyc
pydoc.cpython-36.pyc
queue.cpython-36.opt-1.pyc
queue.cpython-36.opt-2.pyc
queue.cpython-36.pyc
quopri.cpython-36.opt-1.pyc
quopri.cpython-36.opt-2.pyc
quopri.cpython-36.pyc
random.cpython-36.opt-1.pyc
random.cpython-36.opt-2.pyc
random.cpython-36.pyc
re.cpython-36.opt-1.pyc
re.cpython-36.opt-2.pyc
re.cpython-36.pyc
reprlib.cpython-36.opt-1.pyc
reprlib.cpython-36.opt-2.pyc
reprlib.cpython-36.pyc
rlcompleter.cpython-36.opt-1.pyc
rlcompleter.cpython-36.opt-2.pyc
rlcompleter.cpython-36.pyc
runpy.cpython-36.opt-1.pyc
runpy.cpython-36.opt-2.pyc
runpy.cpython-36.pyc
sched.cpython-36.opt-1.pyc
sched.cpython-36.opt-2.pyc
sched.cpython-36.pyc
secrets.cpython-36.opt-1.pyc
secrets.cpython-36.opt-2.pyc
secrets.cpython-36.pyc
selectors.cpython-36.opt-1.pyc
selectors.cpython-36.opt-2.pyc
selectors.cpython-36.pyc
shelve.cpython-36.opt-1.pyc
shelve.cpython-36.opt-2.pyc
shelve.cpython-36.pyc
shlex.cpython-36.opt-1.pyc
shlex.cpython-36.opt-2.pyc
shlex.cpython-36.pyc
shutil.cpython-36.opt-1.pyc
shutil.cpython-36.opt-2.pyc
shutil.cpython-36.pyc
signal.cpython-36.opt-1.pyc
signal.cpython-36.opt-2.pyc
signal.cpython-36.pyc
site.cpython-36.opt-1.pyc
site.cpython-36.opt-2.pyc
site.cpython-36.pyc
smtpd.cpython-36.opt-1.pyc
smtpd.cpython-36.opt-2.pyc
smtpd.cpython-36.pyc
smtplib.cpython-36.opt-1.pyc
smtplib.cpython-36.opt-2.pyc
smtplib.cpython-36.pyc
sndhdr.cpython-36.opt-1.pyc
sndhdr.cpython-36.opt-2.pyc
sndhdr.cpython-36.pyc
socket.cpython-36.opt-1.pyc
socket.cpython-36.opt-2.pyc
socket.cpython-36.pyc
socketserver.cpython-36.opt-1.pyc
socketserver.cpython-36.opt-2.pyc
socketserver.cpython-36.pyc
sre_compile.cpython-36.opt-1.pyc
sre_compile.cpython-36.opt-2.pyc
sre_compile.cpython-36.pyc
sre_constants.cpython-36.opt-1.pyc
sre_constants.cpython-36.opt-2.pyc
sre_constants.cpython-36.pyc
sre_parse.cpython-36.opt-1.pyc
sre_parse.cpython-36.opt-2.pyc
sre_parse.cpython-36.pyc
ssl.cpython-36.opt-1.pyc
ssl.cpython-36.opt-2.pyc
ssl.cpython-36.pyc
stat.cpython-36.opt-1.pyc
stat.cpython-36.opt-2.pyc
stat.cpython-36.pyc
statistics.cpython-36.opt-1.pyc
statistics.cpython-36.opt-2.pyc
statistics.cpython-36.pyc
string.cpython-36.opt-1.pyc
string.cpython-36.opt-2.pyc
string.cpython-36.pyc
stringprep.cpython-36.opt-1.pyc
stringprep.cpython-36.opt-2.pyc
stringprep.cpython-36.pyc
struct.cpython-36.opt-1.pyc
struct.cpython-36.opt-2.pyc
struct.cpython-36.pyc
subprocess.cpython-36.opt-1.pyc
subprocess.cpython-36.opt-2.pyc
subprocess.cpython-36.pyc
sunau.cpython-36.opt-1.pyc
sunau.cpython-36.opt-2.pyc
sunau.cpython-36.pyc
symbol.cpython-36.opt-1.pyc
symbol.cpython-36.opt-2.pyc
symbol.cpython-36.pyc
symtable.cpython-36.opt-1.pyc
symtable.cpython-36.opt-2.pyc
symtable.cpython-36.pyc
sysconfig.cpython-36.opt-1.pyc
sysconfig.cpython-36.opt-2.pyc
sysconfig.cpython-36.pyc
tabnanny.cpython-36.opt-1.pyc
tabnanny.cpython-36.opt-2.pyc
tabnanny.cpython-36.pyc
tarfile.cpython-36.opt-1.pyc
tarfile.cpython-36.opt-2.pyc
tarfile.cpython-36.pyc
telnetlib.cpython-36.opt-1.pyc
telnetlib.cpython-36.opt-2.pyc
telnetlib.cpython-36.pyc
tempfile.cpython-36.opt-1.pyc
tempfile.cpython-36.opt-2.pyc
tempfile.cpython-36.pyc
textwrap.cpython-36.opt-1.pyc
textwrap.cpython-36.opt-2.pyc
textwrap.cpython-36.pyc
this.cpython-36.opt-1.pyc
this.cpython-36.opt-2.pyc
this.cpython-36.pyc
threading.cpython-36.opt-1.pyc
threading.cpython-36.opt-2.pyc
threading.cpython-36.pyc
timeit.cpython-36.opt-1.pyc
timeit.cpython-36.opt-2.pyc
timeit.cpython-36.pyc
token.cpython-36.opt-1.pyc
token.cpython-36.opt-2.pyc
token.cpython-36.pyc
tokenize.cpython-36.opt-1.pyc
tokenize.cpython-36.opt-2.pyc
tokenize.cpython-36.pyc
trace.cpython-36.opt-1.pyc
trace.cpython-36.opt-2.pyc
trace.cpython-36.pyc
traceback.cpython-36.opt-1.pyc
traceback.cpython-36.opt-2.pyc
traceback.cpython-36.pyc
tracemalloc.cpython-36.opt-1.pyc
tracemalloc.cpython-36.opt-2.pyc
tracemalloc.cpython-36.pyc
tty.cpython-36.opt-1.pyc
tty.cpython-36.opt-2.pyc
tty.cpython-36.pyc
types.cpython-36.opt-1.pyc
types.cpython-36.opt-2.pyc
types.cpython-36.pyc
typing.cpython-36.opt-1.pyc
typing.cpython-36.opt-2.pyc
typing.cpython-36.pyc
uu.cpython-36.opt-1.pyc
uu.cpython-36.opt-2.pyc
uu.cpython-36.pyc
uuid.cpython-36.opt-1.pyc
uuid.cpython-36.opt-2.pyc
uuid.cpython-36.pyc
warnings.cpython-36.opt-1.pyc
warnings.cpython-36.opt-2.pyc
warnings.cpython-36.pyc
wave.cpython-36.opt-1.pyc
wave.cpython-36.opt-2.pyc
wave.cpython-36.pyc
weakref.cpython-36.opt-1.pyc
weakref.cpython-36.opt-2.pyc
weakref.cpython-36.pyc
webbrowser.cpython-36.opt-1.pyc
webbrowser.cpython-36.opt-2.pyc
webbrowser.cpython-36.pyc
xdrlib.cpython-36.opt-1.pyc
xdrlib.cpython-36.opt-2.pyc
xdrlib.cpython-36.pyc
zipapp.cpython-36.opt-1.pyc
zipapp.cpython-36.opt-2.pyc
zipapp.cpython-36.pyc
zipfile.cpython-36.opt-1.pyc
zipfile.cpython-36.opt-2.pyc
zipfile.cpython-36.pyc

File Transfer

Upload files to current directory

File Editor: telnetlib.cpython-36.opt-1.pyc

3 \`Z@sJdZddlZddlZddlZddlmZdgZdZdZ e dgZ e dgZ e dgZ e d gZe d gZe dgZe d gZe d gZe d gZe dgZe dgZe dgZe dgZe dgZe dgZe dgZe dgZe dgZe dgZe dgZe dgZe dgZ e dgZ!e dgZ"e dgZ#e dgZ$e dgZ%e dgZ&e d gZ'e d!gZ(e d"gZ)e d#gZ*e d$gZ+e d%gZ,e d&gZ-e d'gZ.e d(gZ/e d)gZ0e d*gZ1e d+gZ2e dgZ3e d,gZ4e d-gZ5e d.gZ6e d/gZ7e d0gZ8e d1gZ9e d2gZ:e d3gZ;e d4gZe d7gZ?e d8gZ@e d9gZAe d:gZBe d;gZCe dgZFe d?gZGe d@gZHe dAgZIe dBgZJe dCgZKe dDgZLe dEgZMe dFgZNe dGgZOe dHgZPe dgZQe dgZReSedIrejTZUnejVZUGdJddZWdKdLZXeYdMkrFeXdS)NaQTELNET client class. Based on RFC 854: TELNET Protocol Specification, by J. Postel and J. Reynolds Example: >>> from telnetlib import Telnet >>> tn = Telnet('www.python.org', 79) # connect to finger port >>> tn.write(b'guido\r\n') >>> print(tn.read_all()) Login Name TTY Idle When Where guido Guido van Rossum pts/2 snag.cnri.reston.. >>> Note that read_all() won't read until eof -- it just reads some data -- but it guarantees to read at least one byte unless EOF is hit. It is possible to pass a Telnet object to a selector in order to wait until more data is available. Note that in this case, read_eager() may return b'' even if there was data on the socket, because the protocol negotiation may have eaten the data. This is why EOFError is needed in some cases to distinguish between "no data" and "connection closed" (since the socket also appears ready for reading when it is closed). To do: - option negotiation - timeout should be intrinsic to the connection object instead of an option on one of the read calls only N) monotonicTelnet  !"#$%&'()*+,-./01 PollSelectorc@seZdZdZddejfddZdejfddZdd Zd d Z d d Z ddZ ddZ ddZ ddZdraTelnet interface class. An instance of this class represents a connection to a telnet server. The instance is initially not connected; the open() method must be used to establish a connection. Alternatively, the host name and optional port number can be passed to the constructor, too. Don't try to reopen an already connected instance. This class has many read_*() methods. Note that some of them raise EOFError when the end of the connection is read, because they can return an empty string for other reasons. See the individual doc strings. read_until(expected, [timeout]) Read until the expected string has been seen, or a timeout is hit (default is no timeout); may block. read_all() Read all data until EOF; may block. read_some() Read at least one byte or EOF; may block. read_very_eager() Read all data available already queued or on the socket, without blocking. read_eager() Read either data already queued or some data available on the socket, without blocking. read_lazy() Read all data in the raw queue (processing it first), without doing any socket I/O. read_very_lazy() Reads all data in the cooked queue, without doing any socket I/O. read_sb_data() Reads available data between SB ... SE sequence. Don't block. set_option_negotiation_callback(callback) Each time a telnet option is read on the input flow, this callback (if set) is called with the following parameters : callback(telnet socket, command, option) option will be chr(0) when there is no option. No other action is done afterwards by telnetlib. NrcCsht|_||_||_||_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ |dk rd|j|||dS)zConstructor. When called without arguments, create an unconnected instance. With a hostname argument, it connects the instance; port number and timeout are optional. Nr) DEBUGLEVEL debuglevelhostporttimeoutsockrawqirawqcookedqeofiacseqsbsbdataqoption_callbackopen)selfrLrMrNrZ!/usr/lib64/python3.6/telnetlib.py__init__szTelnet.__init__cCs6d|_|st}||_||_||_tj||f||_dS)zConnect to a host. The optional second argument is the port number, which defaults to the standard telnet port (23). Don't try to reopen an already connected instance. rN)rS TELNET_PORTrLrMrNsocketZcreate_connectionrO)rYrLrMrNrZrZr[rXsz Telnet.opencCs |jdS)z#Destructor -- close the connection.N)close)rYrZrZr[__del__szTelnet.__del__cGs@|jdkr 0. If extra arguments are present, they are substituted in the message using the standard string formatting operator. rzTelnet(%s,%s): )endN)rKprintrLrM)rYmsgargsrZrZr[rds  z Telnet.msgcCs ||_dS)zhSet the debug level. The higher it is, the more debug output you get (on sys.stdout). N)rK)rYrKrZrZr[set_debuglevelszTelnet.set_debuglevelcCs.|j}d|_d|_d|_d|_|r*|jdS)zClose the connection.NTrIr)rOrSrTrUr_)rYrOrZrZr[r_sz Telnet.closecCs|jS)z)Return the socket object used internally.)rO)rYrZrZr[ get_socketszTelnet.get_socketcCs |jjS)z9Return the fileno() of the socket object used internally.)rOfileno)rYrZrZr[rhsz Telnet.filenocCs4t|kr|jttt}|jd||jj|dS)zWrite a string to the socket, doubling any IAC characters. Can block if the connection is blocked. May raise OSError if the connection is closed. zsend %rN)IACreplacerdrOsendall)rYbufferrZrZr[writes z Telnet.writec Cs t|}|j|jj|}|dkrN||}|jd|}|j|d|_|S|dk r`t|}t}|j|tjx|j s |j |rt dt|j|}|j |j|jj||}|dkr||}|jd|}|j|d|_|S|dk rx|t}|dkrxPqxWWdQRX|j S)aRead until a given string is encountered or until timeout. When no match is found, return whatever is available instead, possibly the empty string. Raise EOFError if the connection is closed and no cooked data is available. rN)len process_rawqrRfind_time_TelnetSelectorregister selectors EVENT_READrSselectmax fill_rawqread_very_lazy)rYmatchrNnibufdeadlineselectorrZrZr[ read_until$s8     zTelnet.read_untilcCs4|jx|js"|j|jq W|j}d|_|S)z7Read all data until EOF; block until connection closed.rI)rorSrxrR)rYr}rZrZr[read_allIs zTelnet.read_allcCs>|jx$|j r,|j r,|j|jq W|j}d|_|S)zRead at least one byte of cooked data unless EOF is hit. Return b'' if EOF is hit. Block if no data is immediately available. rI)rorRrSrx)rYr}rZrZr[ read_someSs zTelnet.read_somecCs6|jx$|j r,|jr,|j|jq W|jS)a Read everything that's possible without blocking in I/O (eager). Raise EOFError if connection closed and no cooked data available. Return b'' if no cooked data available otherwise. Don't block unless in the midst of an IAC sequence. )rorS sock_availrxry)rYrZrZr[read_very_eagerbs  zTelnet.read_very_eagercCs>|jx,|j r4|j r4|jr4|j|jq W|jS)zRead readily available data. Raise EOFError if connection closed and no cooked data available. Return b'' if no cooked data available otherwise. Don't block unless in the midst of an IAC sequence. )rorRrSrrxry)rYrZrZr[ read_eagerps  zTelnet.read_eagercCs|j|jS)aProcess and return data that's already in the queues (lazy). Raise EOFError if connection closed and no data available. Return b'' if no cooked data available otherwise. Don't block unless in the midst of an IAC sequence. )rory)rYrZrZr[ read_lazy~szTelnet.read_lazycCs,|j}d|_| r(|jr(|j r(td|S)zReturn any data available in the cooked queue (very lazy). Raise EOFError if connection closed and no data available. Return b'' if no cooked data available otherwise. Don't block. rIztelnet connection closed)rRrSrPEOFError)rYr}rZrZr[rys zTelnet.read_very_lazycCs|j}d|_|S)aReturn any data available in the SB ... SE queue. Return b'' if no SB ... SE available. Should only be called after seeing a SB or SE command. When a new SB command is found, old unread SB data will be discarded. Don't block. rI)rV)rYr}rZrZr[ read_sb_dataszTelnet.read_sb_datacCs ||_dS)zIProvide a callback function called after each receipt of a telnet option.N)rW)rYcallbackrZrZr[set_option_negotiation_callbacksz&Telnet.set_option_negotiation_callbackc CsXddg}yx|jr |j}|jsj|tkr0q|dkr:q|tkrZ||j|||j<qn|j|7_qt|jdkr(|ttt t fkr|j|7_qd|_|tkr||j|||j<nh|t krd|_d|_ n&|t krd|_|j |d|_ d|d<|jr|j|j|tn|jdt|qt|jdkr|jdd}d|_|}|ttfkr|jd|tkrrdptd t||jr|j|j||n|jjtt |q|t t fkr|jd|t krd pd t||jr|j|j||q|jjtt|qWWn"tk r2d|_d|_YnX|j|d|_|j |d|_ d S) zTransfer from raw queue to cooked queue. Set self.eof when connection is closed. Don't block unless in the midst of an IAC sequence. rIrrzIAC %d not recognizedrz IAC %s %dDODONTWILLWONTN)rP rawq_getcharrTtheNULLrirUrnrrrrSBrVSErWrONOOPTrdordrkrrR)rYr}ccmdoptrZrZr[rosh  zTelnet.process_rawqcCsZ|js|j|jrt|j|j|jd}|jd|_|jt|jkrVd|_d|_|S)zGet next char from raw queue. Block if no data is immediately available. Raise EOFError when connection is closed. rrIr)rPrxrSrrQrn)rYrrZrZr[rs zTelnet.rawq_getcharcCsL|jt|jkrd|_d|_|jjd}|jd|| |_|j||_dS)zFill raw queue from exactly one recv() system call. Block if no data is immediately available. Set self.eof when connection is closed. rIr2zrecv %rN)rQrnrPrOZrecvrdrS)rYr}rZrZr[rxs  zTelnet.fill_rawqc Cs.t}|j|tjt|jdSQRXdS)z-Test whether data is available on the socket.rN)rrrsrtruboolrv)rYrrZrZr[rszTelnet.sock_availcCstjdkr|jdSt}|j|tj|jtjtjxx|jD]\}}|j |kry |j }Wnt k rt ddSX|rtj j|jdtj jqH|j tjkrHtjjjd}|sdS|j|qHWq>WWdQRXdS)z9Interaction function, emulates a very dumb telnet client.Zwin32Nz(*** Connection closed by remote host ***ascii)sysplatform mt_interactrrrsrtrustdinrvZfileobjrrrcstdoutrmdecodeflushreadlineencode)rYrkeyZeventstextlinerZrZr[interacts,     zTelnet.interactcCs@ddl}|j|jfx$tjj}|s(P|j|jdqWdS)z$Multithreaded version of interact().rNr)_threadstart_new_threadlistenerrrrrmr)rYrrrZrZr[r1s zTelnet.mt_interactc CsVxPy |j}Wntk r*tddSX|rDtjj|jdqtjjqWdS)z>Helper for mt_interact() -- this executes in the other thread.z(*** Connection closed by remote host ***Nr)rrrcrrrmrr)rYdatarZrZr[r;s zTelnet.listenerc CsPd}|dd}tt|}x8|D]0}t||ds"|s@ddl}|j||||<q"W|dk rht|}t}|j|tj x|j s|j xP|D]H}||j |j }|r|j} |j d| } |j | d|_ ||| fSqW|dk r|j|} |t}| s|dkrPnq|jqWWdQRX|j} | rF|j rFtdd| fS)aRead until one from a list of a regular expressions matches. The first argument is a list of regular expressions, either compiled (re.RegexObject instances) or uncompiled (strings). The optional second argument is a timeout, in seconds; default is no timeout. Return a tuple of three items: the index in the list of the first regular expression that matches; the match object returned; and the text read up till and including the match. If EOF is read and no text was read, raise EOFError. Otherwise, when nothing matches, return (-1, None, text) where text is the text received so far (may be the empty string if a timeout happened). If a regular expression ends with a greedy match (e.g. '.*') or if more than one expression can match the same input, the results are undeterministic, and may depend on the I/O timing. Nsearchrr)rangernhasattrrecompilerqrrrsrtrurSrorrRrbrvrxryr) rYlistrNrindicesr|r~rmerZreadyrZrZr[expectHsB         z Telnet.expectcCs|S)NrZ)rYrZrZr[ __enter__szTelnet.__enter__cCs |jdS)N)r_)rYtypevalue tracebackrZrZr[__exit__szTelnet.__exit__)N)N)"__name__ __module__ __qualname____doc__r^Z_GLOBAL_DEFAULT_TIMEOUTr\rXr`rdrfr_rgrhrmrrrrrrryrrrorrxrrrrrrrrZrZrZr[rs<5  %    H  8cCsd}x0tjddr4tjddkr4|d}tjd=qWd}tjddrRtjd}d}tjddrtjd}y t|}Wn tk rtj|d}YnXt(}|j||j||dd |j WdQRXdS) zTest program for telnetlib. Usage: python telnetlib.py [-d] ... [host [port]] Default host is localhost; default port is 23. rrNz-dZ localhostrZtcpg?)rN) rargvint ValueErrorr^Z getservbynamerrfrXr)rKrLrMZportstrZtnrZrZr[tests$     r__main__)Zrrr^rtZtimerrq__all__rJr]bytesrirrrrrrZNOPZDMZBRKZIPZAOZAYTZECZELZGArZBINARYZECHOZRCPZSGAZNAMSZSTATUSZTMZRCTEZNAOLZNAOPZNAOCRDZNAOHTSZNAOHTDZNAOFFDZNAOVTSZNAOVTDZNAOLFDZXASCIIZLOGOUTZBMZDETZSUPDUPZ SUPDUPOUTPUTZSNDLOCZTTYPEZEORZTUIDZOUTMRKZTTYLOCZ VT3270REGIMEZX3PADZNAWSZTSPEEDZLFLOWZLINEMODEZXDISPLOCZ OLD_ENVIRONZAUTHENTICATIONZENCRYPTZ NEW_ENVIRONZTN3270EZXAUTHCHARSETZRSPZCOM_PORT_OPTIONZSUPPRESS_LOCAL_ECHOZTLSZKERMITZSEND_URLZ FORWARD_XZ PRAGMA_LOGONZ SSPI_LOGONZPRAGMA_HEARTBEATZEXOPLrrrHrrZSelectSelectorrrrrZrZrZr[ s                                                                          }