Skip to content

Preserve non-UTF-8 bytes in simulator dialogues - #241

Merged
MatthieuDartiailh merged 1 commit into
pyvisa:mainfrom
aamir-azeez:fix/binary-dialogue-dispatch
Sep 28, 2026
Merged

MatthieuDartiailh merged 1 commit into
pyvisa:mainfrom
aamir-azeez:fix/binary-dialogue-dispatch

Conversation

@aamir-azeez

@aamir-azeez aamir-azeez commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #227, reported by BT8298.

Dialogue bytes that are not UTF-8 can raise UnicodeDecodeError. Preserve those bytes during dialogue matching and response formatting; skip text-only setters only if UTF-8 decoding fails.

The suite passes.

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.92%. Comparing base (55a5ce3) to head (ceeb722).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...a_sim/testsuite/test_binary_dialogue_regression.py 96.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   86.78%   87.92%   +1.13%     
==========================================
  Files          19       20       +1     
  Lines        1052     1118      +66     
  Branches      114      116       +2     
==========================================
+ Hits          913      983      +70     
+ Misses        104      103       -1     
+ Partials       35       32       -3     
Flag Coverage Δ
unittests 87.92% <97.14%> (+1.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MatthieuDartiailh
MatthieuDartiailh merged commit 2516e1a into pyvisa:main Sep 28, 2026
17 checks passed
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.

BYTES directive leads to exception when the bytes aren't UTF-8 decodeable

2 participants