mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Victor Stinner's patch to make telnetlib use bytes 3725
This commit is contained in:
parent
33b6450d23
commit
3de7fb86fc
3 changed files with 109 additions and 107 deletions
|
|
@ -225,14 +225,14 @@ A simple example illustrating typical use::
|
|||
|
||||
tn = telnetlib.Telnet(HOST)
|
||||
|
||||
tn.read_until("login: ")
|
||||
tn.write(user + "\n")
|
||||
tn.read_until(b"login: ")
|
||||
tn.write(user.encode('ascii') + b"\n")
|
||||
if password:
|
||||
tn.read_until("Password: ")
|
||||
tn.write(password + "\n")
|
||||
tn.read_until(b"Password: ")
|
||||
tn.write(password.encode('ascii') + b"\n")
|
||||
|
||||
tn.write("ls\n")
|
||||
tn.write("exit\n")
|
||||
tn.write(b"ls\n")
|
||||
tn.write(b"exit\n")
|
||||
|
||||
print(tn.read_all())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue