History

4.0.3
  • bugfix: long-running servers leaked memory through Server _protocols list and _new_client asyncio.Queue. Both are now bounded and regularly pruned.

  • enhancement: telnetlib3.telnet now overlays std library module space, import telnetlib #139.

  • enhancement: telnetlib3-fingerprint-server and telnetlib3-fingerprint client now also detect “telnet loops” and “wrong direction” errors in opposing IAC parser.

  • removed: telnetlib3-fingerprint-server no longer integrates with the (never released) tv-detect package for terminal vulnerability probing.

4.0.2
  • bugfix: MCCP2 decompression failed on MUD servers using raw deflate or gzip-wrapped compression, producing garbled banners. The client now auto-detects zlib/gzip format and falls back to raw deflate when needed.

  • bugfix: NEW_ENVIRON SEND requests that exceed the 256-byte subnegotiation buffer of some telnet clients (e.g. GNU inetutils) are now automatically split into multiple SB frames.

  • bugfix: telnetlib3-server argument --tls-auto deadlocked with plain telnet clients. Detection now uses a non-blocking with a configurable timeout.

  • enhancement: writer.get_extra_info("ssl_object") is available in shell callbacks to detect TLS-secured connections and query the negotiated protocol version and cipher.

  • enhancement: telnetlib3-fingerprint-server integrates with the optional tv-detect package for terminal vulnerability probing.

4.0.1
  • new: --encoding=big5bbs, BBS 半形字 (half-width characters) encoding, matching PCMan/PttBBS terminal clients, popular with Taiwanese BBS culture.

  • enhancement: telnetlib3-client now works on Windows by using the optional blessed>=1.20 dependency, installed automatically for Windows platforms.

  • bugfix: telnetlib3-client could begin a shell in wrong ECHO mode, depending on order of options in a “connection burst”.

  • bugfix: TelnetSessionContext gmcp_data mutable default argument caused all instances to share a single dict, so GMCP data from one connection contaminated subsequent connections.

  • bugfix: keyboard escape detection raised UnicodeDecodeError on non-UTF-8 terminal input bytes; now uses errors="replace".

4.0.0
  • removed: telnetlib3.color_filter. ColorFilter, ColorConfig, PALETTES, PetsciiColorFilter, and AtasciiControlFilter have all been moved to the downstream Telix project, recommended for connecting to legacy BBSs systems requiring color correction.

    telnetlib3-client CLI args --colormatch, --color-brightness, --color-contrast, --background-color, --ice-colors removed.

3.0.3
  • bugfix: server and client now correctly complete LINEMODE negotiation when prompted to.

  • new: --logfile-mode {append,rewrite} and --typescript-mode CLI flags and make_logger() filemode argument control whether the log file is appended to (default) or overwritten on each connection.

  • new: LinemodeBuffer used by telnetlib3-client, a client-side line buffer for LINEMODE EDIT mode with local erase-char, erase-line, erase-word editing, forwardmask flushing, and TRAPSIG IAC command generation. The default ‘telsh’ server was also updated to support linemode.

3.0.2
3.0.1
  • change: Unused client argument gmcp_log removed.

  • new: MCCP2 and MCCP3. Both client and server ends passively support if requested, and request support by –compression or deny support by –no-compression.

  • new: on_request_charset() and on_request_environ() offer callbacks on the client, symmetric with the existing server-side callbacks.

3.0.0
  • change: connect_minwait default now 0 (was 1.0 seconds in library API).

  • change: force_binary auto-enabled when CHARSET is negotiated (RFC 2066) or LANG/CHARSET received via NEW_ENVIRON (RFC 1572). SyncTERM font detection also enables it unconditionally.

  • change: --connect-timeout default changed from no limit to 10 seconds.

  • change: --reverse-video CLI option from 2.4.0 was removed.

  • change: CGA, EGA, and Amiga palettes removed from --colormatch; only vga is available at this time. ice_colors are now True by default.

  • bugfix: read_some() in synchronous API (TelnetConnection and ServerConnection) blocked until EOF instead of returning available data. Now returns as soon as any data is available.

  • new: TelnetSessionContext base class and writer.ctx attribute for per-connection session state. Subclass to add application-specific attributes (e.g. MUD client state).

  • new: --ice-colors (default on) treats SGR 5 (blink) as bright background for proper 16-color BBS/ANSI art display.

  • new: --typescript FILE records session output to a file, similar to the Unix script(1) command.

  • new: shared TelnetProtocolBase mixin extracted from duplicated server and client protocol code.

  • new: _atomic_json_write() and _BytesSafeEncoder helpers in _paths module for fingerprinting subsystem.

  • enhancement: Microsoft Telnet (telnet.exe) compatibility refined, server now sends DO NEW_ENVIRON but excludes USER variable instead of skipping the option entirely, #24.

  • enhancement: comprehensive pylint and mypy cleanup across the codebase.

2.6.1
  • bugfix: dependency of wcwidth version.

2.6.0
  • new: TLS support (TELNETS). open_connection() accepts an ssl parameter (True, or an ssl.SSLContext). create_server() accepts an ssl parameter (ssl.SSLContext). New CLI options: --ssl, --ssl-cafile, --ssl-no-verify for telnetlib3-client; --ssl-certfile, --ssl-keyfile, and --tls-auto for telnetlib3-server.

  • new: the default server shell now displays Ready (secure: TLSv1.3). for TLS connections (the protocol version shown is negotiated dynamically).

  • bugfix: telnetlib3-client now sets terminal mode to the server’s preference via WILL ECHO and WILL SGA negotiation. Use --raw-mode to restore legacy raw mode for servers that don’t negotiate.

  • bugfix: telnetlib3-client declines MUD protocol options (GMCP, MSDP, MSSP, MSP, MXP, ZMP, AARDWOLF, ATCP) by default. Use --always-do or --always-will to opt in.

  • bugfix: log output “staircase text” in raw terminal mode.

  • bugfix: graceful EOF handling, connection close no longer prints a traceback.

2.5.0
  • change: telnetlib3-client now defaults to raw terminal mode (no line buffering, no local echo), which is correct for most servers. Use --line-mode to restore line-buffered local-echo behavior.

  • change: telnetlib3-server --pty-exec now defaults to raw PTY mode. Use --line-mode to restore cooked PTY mode with echo.

  • change: connect_minwait default reduced to 0 across BaseClient, open_connection(), and telnetlib3-client. Negotiation continues asynchronously. Use --connect-minwait to restore a delay if needed, or use wait_for() in server or client shells to await a specific negotiation state.

  • new: color, keyboard input translation, and --encoding support for ATASCII (ATARI ASCII) and PETSCII (Commodore ASCII).

  • new: SyncTERM/CTerm font selection sequence detection (CSI Ps1 ; Ps2 SP D). Both telnetlib3-fingerprint and telnetlib3-client detect font switching and auto-switch encoding to the matching codec (e.g. font 36 = ATASCII, 32–35 = PETSCII, 0 = CP437). Explicit --encoding takes precedence.

  • new: TRACE log level (5, below DEBUG) with hexdump()-style output for all sent and received bytes. Use --loglevel=trace.

  • bugfix: robot_check() now uses a narrow character (space) instead of a wide Unicode character, allowing retro terminal emulators to pass.

  • bugfix: ATASCII codec now maps bytes 0x0D and 0x0A to CR and LF instead of graphics characters, fixing garbled output when connecting to Atari BBS systems.

  • bugfix: ATASCII codec normalizes CR and CRLF to the native ATASCII EOL (0x9B) during encoding, so the Return key works correctly.

  • bugfix: PETSCII bare CR (0x0D) is now normalized to CRLF in raw terminal mode and to LF in telnetlib3-fingerprint banners.

  • bugfix: telnetlib3-fingerprint re-encodes prompt responses for retro encodings so servers receive the correct EOL byte.

  • bugfix: telnetlib3-fingerprint no longer crashes with LookupError when the server negotiates an unknown charset. Banner formatting falls back to latin-1.

  • bugfix: send_charset() normalizes non-standard encoding names (iso-8859-02 to iso-8859-2, cp-1250 to cp1250, etc.).

  • enhancement: telnetlib3-fingerprint responds more like a terminal and to more y/n prompts about colors, encoding, etc. to collect more banners for the bbs.modem.xyz project.

  • enhancement: telnetlib3-fingerprint banner formatting uses surrogateescape error handler, preserving raw high bytes (e.g. CP437 art) as surrogates instead of replacing them with U+FFFD.

2.4.0
  • new: telnetlib3.color_filter module, translates 16-color ANSI SGR codes to 24-bit RGB from hardware palettes (EGA, CGA, VGA, xterm). Enabled by default. New client CLI options: --colormatch, --color-brightness, --color-contrast, --background-color, --reverse-video.

  • new: zmp_decode(), atcp_decode(), and aardwolf_decode() decode functions for ZMP (option 93), ATCP (option 200), and Aardwolf (option 102) MUD protocols.

  • new: handle_zmp(), handle_atcp(), handle_aardwolf(), handle_msp(), and handle_mxp() callbacks for receiving MUD extended protocol subnegotiations, with accumulated data stored in zmp_data, atcp_data, and aardwolf_data attributes.

  • new: COM-PORT-OPTION (RFC 2217) subnegotiation parsing with comport_data attribute and request_comport_signature().

  • enhancement: telnetlib3-fingerprint now always probes extended MUD options (MSP, MXP, ZMP, AARDWOLF, ATCP) during server scans and captures ZMP, ATCP, Aardwolf, MXP, and COM-PORT data in session output.

  • enhancement: telnetlib3-fingerprint smart prompt detectionm auto-answers yes/no, color, UTF-8 menu, who, and help prompts.

  • enhancement: --banner-max-bytes option for telnetlib3-fingerprint; default raised from 1024 to 65536.

  • new: ATASCII (Atari 8-bit) codec, --encoding=atascii for connecting to Atari BBS systems. Maps all 256 byte values to Unicode including graphics characters, card suits, and the inverse-video range (0x80–0xFF). ATASCII EOL (0x9B) maps to newline. Aliases: atari8bit, atari_8bit.

  • enhancement: --encoding=atascii, --encoding=petscii, and --encoding=atarist now auto-enable --force-binary for both client and server, since these encodings use bytes 0x80–0xFF for standard glyphs.

  • bugfix: rare LINEMODE ACK loop with misbehaving servers that re-send unchanged MODE without ACK.

  • bugfix: unknown IAC commands no longer raise ValueError; treated as data.

  • bugfix: client no longer asserts on TTYPE IS from server.

  • bugfix: request_forwardmask() only called on server side.

  • change: wcwidth is now a required dependency.

2.3.0
  • bugfix: repeat “socket.send() raised exception.” exceptions.

  • bugfix: server incorrectly accepted DO TSPEED and DO SNDLOC with WILL responses. These are client-only options per RFC 1079 and RFC 779; the server now correctly rejects them.

  • bugfix: LINEMODE DO FORWARDMASK subnegotiation no longer raises NotImplementedError; the mask is accepted (logged only).

  • bugfix: echo doubling in --pty-exec without --pty-raw (linemode).

  • bugfix: missing LICENSE.txt in sdist file.

  • bugfix: GMCP, MSDP, and MSSP decoding now uses --encoding when set, falling back to latin-1 for non-UTF-8 bytes instead of lossy replacement.

  • bugfix: NEW_ENVIRON SEND with empty payload now correctly interpreted as “send all” per RFC 1572.

  • new: telnetlib3.mud module with encode/decode functions for GMCP (option 201), MSDP (option 69), and MSSP (option 70) MUD telnet protocols.

  • new: send_gmcp(), send_msdp(), and send_mssp() methods for sending MUD protocol data, with corresponding handle_gmcp(), handle_msdp(), and handle_mssp() callbacks.

  • new: connect_timeout parameter for client and --connect-timeout CLI argument, #30.

  • new: telnetlib3-fingerprint-server CLI with extended NEW_ENVIRON for fingerprinting of connected clients.

  • new: telnetlib3-fingerprint CLI for fingerprinting the given remote server, probing telnet option support and capturing banners.

  • enhancement: reversed WILL/DO for directional options (e.g. WILL NAWS from server, DO TTYPE from client) now gracefully refused with DONT/WONT instead of raising ValueError.

  • enhancement: NEW_ENVIRON SEND and response logging improved, SEND (all) / env send: (empty) instead of raw byte dumps.

  • enhancement: telnetlib3-fingerprint now probes MSDP and MSSP options and captures MSSP server status data in session output.

  • new: --always-will, --always-do, --scan-type, --mssp-wait, --banner-quiet-time, --banner-max-wait options for telnetlib3-fingerprint.

2.2.0
  • bugfix: workaround for Microsoft Telnet client crash on SB NEW_ENVIRON SEND, #24. Server now defers DO NEW_ENVIRON until TTYPE cycling identifies the client, skipping it entirely for MS Telnet (ANSI/VT100).

  • bugfix: handling of LINEMODE FORWARDMASK command bytes.

  • bugfix: SLC fingerprinting byte handling.

  • bugfix: send IAC GA (Go-Ahead) after prompts when SGA is not negotiated. Fixes hanging for MUD clients like Mudlet. PTY shell uses a 500ms idle timer. Use --never-send-ga to suppress like old behavior.

  • performance: with smarter negotiation, default connect_maxwait reduced from 4.0s to 1.5s.

  • performance: both client and server protocol data_received methods have approximately 50x throughput improvement in bulk data transfers.

  • new: Server class returned by create_server() with wait_for_client() method and clients property for tracking connected clients.

  • new: wait_for() and wait_for_condition() methods for waiting on telnet option negotiation state.

  • new: telnetlib3.sync module with blocking (non-asyncio) APIs: TelnetConnection for clients, BlockingTelnetServer for servers.

  • new: server_pty_shell module demonstrating telnetlib3-server --pty-exec CLI argument and related --pty-raw server CLI option for raw PTY mode, used by most programs that handle their own terminal I/O.

  • new: guard_shells module with --robot-check and --pty-fork-limit CLI arguments for connection limiting and bot detection.

  • new: fingerprinting module for telnet client identification and capability probing.

  • new: --send-environ client CLI option to control which environment variables are sent via NEW_ENVIRON. Default no longer includes HOME or SHELL.

2.0.8
  • bugfix: object has no attribute _extra, #100.

2.0.7
  • bugfix: respond WILL CHARSET with DO CHARSET.

2.0.6
  • bugfix: corrected CHARSET protocol client/server role behavior, #59.

  • bugfix: allow --force-binary and --encoding to be combined to prevent long “encoding failed after 4.00s” delays in telnetlib3-server with non-compliant clients, #74.

  • bugfix: reduce telnetlib3-client connection delay; session begins as soon as TTYPE and either NEW_ENVIRON or CHARSET negotiation is completed.

  • bugfix: remove “‘NoneType’ object has no attribute ‘is_closing’” message on some types of closed connections.

  • bugfix: further improve telnetlib3-client performance, capable of 11.2 Mbit/s or more.

  • bugfix: more gracefully handle unsupported SB STATUS codes.

  • feature: telnetlib3-client now negotiates terminal resize events.

2.0.5
  • feature: legacy telnetlib.py from Python 3.11 now redistributed; note change to project LICENSE.txt file.

  • feature: add readuntil_pattern(), #92 by agicy.

  • feature: add wait_closed() async method in response to #82.

  • bugfix: README examples do not work, #81.

  • bugfix: TypeError: buf expected bytes, got <class 'str'> on client timeout in TelnetServer, #87.

  • bugfix: performance issues with client protocol under heavy load; demonstrating server telnet://1984.ws now documented in README.

  • bugfix: annoying “socket.send() raised exception” repeating warning, #89.

  • bugfix: legacy use of get_event_loop, #85.

  • document: about encoding and force_binary in response to #90.

  • feature: add tests to source distribution, #37.

  • test coverage increased by ~20%.

2.0.4
  • change: stop using setuptools library to get current software version.

2.0.3
2.0.2
  • bugfix: NameError: name sleep is not defined in stream_writer.py.

2.0.1
2.0.0
  • change: support Python 3.9, 3.10, 3.11. Drop Python 3.6 and earlier. All code and examples have been updated to the new-style PEP-492 syntax.

  • change: the loop, event_loop, and log arguments are no longer accepted by any class initializers.

  • note: this release has a known memory leak when using the _waiter_connected and _waiter_closed arguments to Client or Shell class initializers; please do not use them. A replacement wait_for_negotiation awaitable is planned for a future release.

  • enhancement: add COM-PORT-OPTION subnegotiation support, #57 by albireox.

1.0.4
  • bugfix: TypeError on EOF/Timeout, introduced in previous version 1.0.3, #51 by zofy.

1.0.3
  • bugfix: circular reference between transport and protocol, #43 by fried.

1.0.2
  • add --speed argument to telnet client, #35 by hughpyle.

1.0.1
  • add Python 3.7 support, drop Python 3.4 and earlier, #33 by AndrewNelis.

1.0.0
  • First general release for standard API: instead of encouraging Twisted-like override of protocol methods, we provide a “shell” callback interface, receiving argument pairs (reader, writer).

0.5.0
  • bugfix: linemode MODE is now acknowledged.

  • bugfix: default stream handler sends 80 x 24 in cols x rows, not 24 x 80.

  • bugfix: waiter_closed future on client defaulted to wrong type.

  • bugfix: telnet shell (TelSh) no longer paints over final exception line.

0.4.0
  • bugfix: cannot connect to IPv6 address as client.

  • change: TelnetClient.CONNECT_DEFERED class attribute renamed DEFERRED. Default value changed to 50ms from 100ms.

  • change: TelnetClient.waiter renamed to TelnetClient.waiter_closed.

  • enhancement: TelnetClient.waiter_connected future added.

0.3.0
  • bugfix: cannot bind to IPv6 address, #5.

  • enhancement: futures waiter_connected and waiter_closed added to server.

  • change: TelSh.feed_slc merged into TelSh.feed_byte as slc_function keyword.

  • change: TelnetServer.CONNECT_DEFERED class attribute renamed DEFERRED. Default value changed to 50ms from 100ms.

  • enhancement: default TelnetServer.PROMPT_IMMEDIATELY = False ensures prompt is not displayed until negotiation is considered final. It is no longer “aggressive”.

  • enhancement: TelnetServer.pause_writing and resume_writing callback wired.

  • enhancement: TelSh.pause_writing and resume_writing methods added.

0.2.4
  • bugfix: pip installation issue, #8.

0.2
  • enhancement: various example programs were included in this release.

0.1
  • Initial release.