Skip to content

fix: validate TSP loadscript write spans - #586

Closed
AjTheSpidey wants to merge 1 commit into
tektronix:mainfrom
AjTheSpidey:codex/tsp-load-script-termination
Closed

fix: validate TSP loadscript write spans#586
AjTheSpidey wants to merge 1 commit into
tektronix:mainfrom
AjTheSpidey:codex/tsp-load-script-termination

Conversation

@AjTheSpidey

Copy link
Copy Markdown

This fixes #500 by checking the full loadscript command before it is sent to the instrument. The existing single-write behavior is kept, but the code now rejects any newline-delimited span longer than the TSP input limit, so a script line cannot run past the required write termination point. The check happens before the old script is deleted, so an invalid script body does not leave the device half-updated.

I added coverage in the SMU test for the 1000-character boundary and for rejecting the over-limit case before a write is sent. I also updated the unreleased changelog.

Tested locally on Windows with Python 3.14:

  • poetry run pytest tests/test_smu.py -q
  • poetry run pytest -q -k "not test_docs"
  • poetry run ruff format --check .
  • poetry run ruff check .
  • poetry run pyright

I also tried pre-commit run --all-files, but it did not finish locally even after a longer timeout, so I did not count that as passing.

@AjTheSpidey
AjTheSpidey requested review from a team as code owners May 19, 2026 20:04
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@nfelt14

nfelt14 commented May 19, 2026

Copy link
Copy Markdown
Collaborator

This seems to be a duplicate of #581

@AjTheSpidey

Copy link
Copy Markdown
Author

Closing this since #581 already covers it.

@AjTheSpidey
AjTheSpidey deleted the codex/tsp-load-script-termination branch May 20, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: TSP devices don't check for a write_termination character when loading a script

3 participants