Skip to content

Preserve explicit empty-string arguments in OSC TCP clients - #200

Open
civilwarinfrance wants to merge 1 commit into
attwad:mainfrom
civilwarinfrance:fix/preserve-empty-string-arguments
Open

civilwarinfrance wants to merge 1 commit into
attwad:mainfrom
civilwarinfrance:fix/preserve-empty-string-arguments

Conversation

@civilwarinfrance

Copy link
Copy Markdown

build_msg('/v', '') currently produces a message with no arguments. Both synchronous and asynchronous TCP clients use that helper, so an explicitly supplied empty string is silently dropped. The UDP client already sends it correctly. This can prevent an OSC receiver from clearing a string-valued control.

Use an empty tuple for omitted values and let explicit strings follow the normal scalar path. Update both TCP defaults together so omitted values still produce argument-free messages. Add API documentation, a changelog entry and regression tests covering literal OSC bytes, both TCP clients, the existing UDP behavior, omitted values, empty iterables, zero, false, nil and generators.

Validation:

  • Original revision: 3 new tests fail; 5 tests and 7 subtests pass as controls.
  • Final source and installed-wheel suites: 189 tests and 9 subtests pass, with 92% source coverage.
  • Locked Ruff lint/format and Mypy checks pass across the project and examples. The installed wheel includes its typing marker and passes the published-package type check.
  • All installed pre-commit hooks pass for the changed files, including the hook's older Mypy version. Running every hook on every repository file still reports eight existing Mypy errors because its isolated environment lacks pytest; those exact errors also occur on the original revision. The project's prescribed uv run mypy pythonosc examples passes with its locked dependencies.
  • Wheel and sdist build successfully; installed runtime and test files match the tested checkout.

Related: #95 established support for empty OSC strings; this fixes their handling in the newer shared message helper and TCP clients.

AI assistance was used to investigate, implement and test this change.

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.

1 participant