You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python's built-in telnetlib is being deprecated in Python 3.11 (see PEP 594), and should be migrated towards telnetlib3.
telnetlib3 is an asyncio-capable library, and some modifications will need to be made, accordingly. Still, they've got a nice example of a client in their README:
importasyncio, telnetlib3@asyncio.coroutinedefshell(reader, writer):
whileTrue:
# read stream until '?' mark is foundoutp=yieldfromreader.read(1024)
ifnotoutp:
# End of Filebreakelif'?'inoutp:
# reply all questions with 'y'.writer.write('y')
# display all server outputprint(outp, flush=True)
# EOFprint()
loop=asyncio.get_event_loop()
coro=telnetlib3.open_connection('localhost', 6023, shell=shell)
reader, writer=loop.run_until_complete(coro)
loop.run_until_complete(writer.protocol.waiter_closed)
Furthermore, it appears that the client.open_connection method will return a tuple of the reader/writer objects that can be used with other logic. Perhaps they could be sent as a tuple to the SELClient object?
The text was updated successfully, but these errors were encountered:
Python's built-in
telnetlib
is being deprecated in Python 3.11 (see PEP 594), and should be migrated towards telnetlib3.telnetlib3
is an asyncio-capable library, and some modifications will need to be made, accordingly. Still, they've got a nice example of a client in their README:Furthermore, it appears that the
client.open_connection
method will return a tuple of the reader/writer objects that can be used with other logic. Perhaps they could be sent as a tuple to the SELClient object?The text was updated successfully, but these errors were encountered: