Skip to content

Commit

Permalink
fix: Handle null term char (#394)
Browse files Browse the repository at this point in the history
* fix: Handle null term char

For tcpip connection, handle when termination char is \0 rather than
\n or \r.

* Add to changelog

---------

Co-authored-by: Matthieu Dartiailh <[email protected]>
  • Loading branch information
jonyscathe and MatthieuDartiailh authored Oct 9, 2023
1 parent 7e6225d commit 79fd091
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ PyVISA-py Changelog
- addd URL-support to ASLR devices PR #386
- add support for GPIB secondary addresses
- fix missing sock.close() in rpc _connect()
- fix HiSLIP message tracking after read timeout #376
- fix HiSLIP message tracking after read timeout PR #376
- handle read_termination of null in tcipip PR #394

0.7.0 (05/05/2023)
------------------
Expand Down
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""
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 79fd091

Please sign in to comment.