Skip to content

v0.2.0

Latest

Choose a tag to compare

@GraysonBellamy GraysonBellamy released this 28 Sep 21:36
· 20 commits to main since this release
v0.2.0
c1ded29

Added

  • canonical_port_name(path, *, platform=None): one name for every spelling of a port, for use as a "same port?" key. On Windows, com8, \\.\COM8 and \\?\COM8 all give COM8, the PortInfo.device discovery reports. On POSIX, a /dev/serial/by-id/... symlink resolves to its /dev/ttyUSB0 target.
  • anyserial.testing.faults_of(port): the live FaultPlan of a MockBackend-backed port, such as either end of serial_port_pair(), so tests can inject faults without reaching into port._backend.
  • Windows: SerialPort.port_info is populated when the port opens. It was always None before.

Changed

  • find_serial_port(device=...) matches any name of the port: device="com8" finds COM8 on Windows, and a by-id symlink finds its target on POSIX. Every name that matched before still matches.

Fixed

  • Windows, Trio: an idle receive() / receive_into() no longer fails with [WinError 1460] This operation returned because the timeout period expired about 1 ms after the call.
  • Windows, Trio: waiting for a modem event no longer fails with TypeError.
  • Windows, asyncio: cancelling a modem-event wait no longer corrupts memory and crashes the process.
  • Windows: paths that start with \\?\ open correctly. Before, \\.\ was prepended to them.
  • Windows discovery reports vid, pid and serial_number for FTDI adapters, and serial_number for USB devices that have one. The FTDI serial number matches what Linux and macOS report.

See CHANGELOG.md for details.