Skip to content

Commit

Permalink
fix: Handle null term char
Browse files Browse the repository at this point in the history
For tcpip connection, handle when termination char is \0 rather than
\n or \r.
  • Loading branch information
jonyscathe committed Sep 24, 2023
1 parent ecfede9 commit b673307
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyvisa_py/tcpip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ def read(self, count: int) -> Tuple[bytes, StatusCode]:
chunk_length = self.max_recv_size

term_char, _ = self.get_attribute(ResourceAttribute.termchar)
term_byte = common.int_to_byte(term_char) if term_char else b""
term_byte = common.int_to_byte(term_char) if term_char is not None else b""

Check warning on line 1149 in pyvisa_py/tcpip.py

View check run for this annotation

Codecov / codecov/patch

pyvisa_py/tcpip.py#L1149

Added line #L1149 was not covered by tests
term_char_en, _ = self.get_attribute(ResourceAttribute.termchar_enabled)
suppress_end_en, _ = self.get_attribute(ResourceAttribute.suppress_end_enabled)

Expand Down

0 comments on commit b673307

Please sign in to comment.