diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-10-15 20:54:24 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-10-15 20:54:24 (GMT) |
commit | 3de7fb86fc9e053955dae144b4fe6e080f5a4d81 (patch) | |
tree | 72032ea6802f31b3cf2923f73385f2e7eae79870 /Doc/library/telnetlib.rst | |
parent | 33b6450d23cbe66457e3392b9d187f20d888601c (diff) | |
download | cpython-3de7fb86fc9e053955dae144b4fe6e080f5a4d81.zip cpython-3de7fb86fc9e053955dae144b4fe6e080f5a4d81.tar.gz cpython-3de7fb86fc9e053955dae144b4fe6e080f5a4d81.tar.bz2 |
Victor Stinner's patch to make telnetlib use bytes 3725
Diffstat (limited to 'Doc/library/telnetlib.rst')
-rw-r--r-- | Doc/library/telnetlib.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/telnetlib.rst b/Doc/library/telnetlib.rst index 4fd8896..a371e0c 100644 --- a/Doc/library/telnetlib.rst +++ b/Doc/library/telnetlib.rst @@ -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()) |