mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-27 17:44:42 +00:00
fixes for Python 3: fix telneturl
This commit is contained in:
parent
736d2a786d
commit
a2e67af7b4
2 changed files with 6 additions and 6 deletions
|
|
@ -64,13 +64,13 @@ class TelnetUrl (urlbase.UrlBase):
|
|||
self.url_connection.set_debuglevel(1)
|
||||
self.url_connection.open(self.host, self.port)
|
||||
if self.user:
|
||||
self.url_connection.read_until("login: ", 10)
|
||||
self.url_connection.write(encode(self.user)+"\n")
|
||||
self.url_connection.read_until(b"login: ", 10)
|
||||
self.url_connection.write(encode(self.user)+b"\n")
|
||||
if self.password:
|
||||
self.url_connection.read_until("Password: ", 10)
|
||||
self.url_connection.write(encode(self.password)+"\n")
|
||||
self.url_connection.read_until(b"Password: ", 10)
|
||||
self.url_connection.write(encode(self.password)+b"\n")
|
||||
# XXX how to tell if we are logged in??
|
||||
self.url_connection.write("exit\n")
|
||||
self.url_connection.write(b"exit\n")
|
||||
|
||||
def can_get_content (self):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ def start_server (host, port, stop_event):
|
|||
try:
|
||||
client = telnetlib.Telnet(timeout=TIMEOUT)
|
||||
client.open(host, port)
|
||||
client.write("exit\n")
|
||||
client.write(b"exit\n")
|
||||
break
|
||||
except:
|
||||
time.sleep(0.5)
|
||||
|
|
|
|||
Loading…
Reference in a new issue