Repository navigation
Preserve PySerial URLs when opening ASRL resources on Windows - #664
Conversation
Well, it would be nice to document the different types of serial board formats accepted in
Where is this? Maybe I'm missing something. |
Signed-off-by: CAOShurong <170531907+CAOShurong@users.noreply.github.com>
|
Added the ASRL board formats and URL-handler examples to the Supported VISA resources notes in The earlier "documented" reference was the URL-handler note in Strict Sphinx HTML build passes; serial tests pass twice (21 each), and the full suite is 353 passed / 131 skipped. USB notes are untouched. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #664 +/- ##
==========================================
+ Coverage 54.74% 57.23% +2.48%
==========================================
Files 39 39
Lines 6518 6542 +24
Branches 649 650 +1
==========================================
+ Hits 3568 3744 +176
+ Misses 2854 2688 -166
- Partials 96 110 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The default install skips test_serial and leaves the URL-routing regression untested. Install the existing serial extra in the unit-test matrix without changing runtime requirements or coverage thresholds. Signed-off-by: CAOShurong <170531907+CAOShurong@users.noreply.github.com>
|
@CAOShurong can you address the merge conflict |
# Conflicts: # CHANGES
# Conflicts: # CHANGES
Follow-up to the serial URL support introduced in #386 and discussed in #385.
On Windows,
SerialSession.after_parsingprefixes every board withCOMbeforecalling
serial_for_url. That is necessary for numeric VISA boards, but turnsloop://andsocket://...into unknowncomloop/comsocketprotocols.The documented URL resources therefore cannot open on Windows, including the
socket handler used for TCP-to-serial converters.
Only add the prefix when the board has no
://, matching PySerial's own URLdispatch. Numeric Windows boards still map to COM ports, POSIX device names are
unchanged, and custom URL handlers are not restricted to a built-in whitelist.
Discovery, serial attributes, I/O, error mapping and session lifetime are unchanged.
Regression coverage checks exact forwarding of six URL forms under both values
of the platform flag, native COM/POSIX mapping, and a real PySerial loopback through
ResourceManager.open_resource. The existing loopback test is unchanged.Validation on Windows, Python 3.13.1, PyVISA 1.16.2 and PySerial 3.5:
succeed, while six VISA URL cases fail before the fix. The new regression
suite is 8 failed / 13 passed before the repair.
python -m pytest pyvisa_py/testsuite/test_serial.py -q: 21 passed, repeated.Serial/session/high-level subset: 24 passed.
and independently installed wheel each 353 passed / 131 skipped. All 465 other
existing outcomes are unchanged; the existing serial failure is fixed and
18 added cases pass. All 484 source/installed outcomes match.
python -m pre_commit run --all-files, strict SphinxHTML build, sdist-to-wheel build, noneditable install and
pip check: passed.A separate full mypy run in the fuller measurement environment reports the
same two pre-existing
tcpip.py:2102errors on base and head; this is not anunconditional full-type-check-green claim.
pyvisa-info/pyvisa-shell --backend pypaths pass: loopback and synthetic local socketquery/binary I/O, read timeout/recovery, close, unknown handler, refused
connection and malformed URL. Git, sdist, wheel and installed Python bytes
were compared. Initial harness assumptions were corrected against direct
PySerial controls; the original failed runs were retained.
Physical COM/RS232 instruments, an RFC2217 server, vendor/Keysight instrumentation,
other local OS/Python versions and production acquisition were not tested. The
socket peer is a synthetic echo endpoint, not independent hardware validation;
the platform-flag cases do not establish native Linux/macOS execution.
Disclosure: Codex generated/edited the code, tests, validation harnesses and this
PR text. No personal human review is claimed.
docs/source/compliance.rst; corrected the loop/socket examples inindex.rst.The earlier URL-handler note was in
docs/source/index.rst, but the compliancenotes were missing this information. This restores existing URL routing; no
new interface or protocol-compliance behavior is introduced.