telnetlib模块读取回显报错,这是为什么呢

一个简单的telnet的实验,想通过telnetlib.read_all()方法读取回显,但是这里报错,这是为什么

img

import telnetlib
            
host = "192.168.56.2"
user = "huawei"
password = "Sn@123321"
            
            
tn = telnetlib.Telnet(host)
tn.read_until(b"Username:")
tn.write(user.encode("ascii") +  b"\n")
tn.read_until(b"Password:")
tn.write(password.encode("ascii") + b"\n")
#tn.write(b"N\n")
            
tn.write(b"system\n")
tn.write(b"interface loopback 1\n")
tn.write(b"ip address 1.1.1.1 255.255.255.255\n")
tn.write(b"commit\n")
tn.write(b"quit\n")
tn.write(b"quit\n")
tn.write(b"quit\n")
            
print("quit")
print(tn.read_all().decode('ascii'))
print("end")