[New-bugs-announce] [issue10176] telnetlib.Telnet.read_very_eager() performance

ptz report at bugs.python.org
Sat Oct 23 12:31:26 CEST 2010


New submission from ptz <pptzpp at gmail.com>:

In Python 2.4, Assuming we've imported telnetlib, the following works:

    >>> f = telnetlib.Telnet("some_text_based_server")
    >>> f.read_very_eager()

The last call outputs the text that the server outputs upon connection (e.g. "login: ").

However, if we put this inside a function it does not work:

    >>> def g():
    ...   f = telnetlib.Telnet("server")
    ...   data = f.read_very_eager()
    ...   print data
    ...
    >>> g()

This returns the empty string. I believe this indicates that the data from the server isn't cooked. 

Note that if we use read_until() instead of read_very_eager(), everything works as expected, further supporting the hypothesis that data doesn't cook properly when the functions are called as above.

So why the difference?

----------
components: Library (Lib)
messages: 119423
nosy: ptz
priority: normal
severity: normal
status: open
title: telnetlib.Telnet.read_very_eager() performance
type: behavior
versions: 3rd party

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10176>
_______________________________________


More information about the New-bugs-announce mailing list