jerpelea opened a new pull request, #21287:
URL: https://github.com/apache/nuttx/pull/21287

   ## Summary
   
   telnetlib was removed in Python 3.13 (PEP 594). The top-level "import 
telnetlib" makes flash_writer.py fail at import time on 3.13+ with 
ModuleNotFoundError, which breaks serial (-s) users too, not only telnet (-t) 
users. On 3.12 and older it only emits a DeprecationWarning.
   
   Replace it with a minimal in-file synchronous shim, _TelnetConn, built on 
the stdlib socket and select modules only. It mirrors the CPython 3.12 
telnetlib behavior that TelnetDev relies on:
   
   * write() doubles IAC bytes.
   * Incoming data: IAC IAC is un-doubled, DO/DONT are refused with WON'T and 
WILL/WON'T with DONT, SB ... SE data is discarded and NUL and XON are dropped.
   * read_eager() does not block, returns b"" when nothing is ready and raises 
EOFError at EOF.
   * The socket timeout is kept after connect and the socket is closed in 
__del__.
   
   Telnet mode is kept, as requested in the review of #18414, and no new 
dependency is added. Only TelnetDev's constructor call changes.
   
   Tested without hardware: a differential test against the 3.12 telnetlib (537 
byte streams, identical output, replies and EOF behavior) and an end-to-end run 
against an emulated updater over a pty pair and a telnet listener on Python 
3.12, 3.13 and 3.14.
   
   ## Impact
   
   RELEASE
   
   ## Testing
   
   CI


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to