From b6733075fe445c2f4668192575f9ec33f6736e66 Mon Sep 17 00:00:00 2001 From: Jonathan Forrest Date: Mon, 25 Sep 2023 05:48:05 +1000 Subject: [PATCH] fix: Handle null term char For tcpip connection, handle when termination char is \0 rather than \n or \r. --- pyvisa_py/tcpip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyvisa_py/tcpip.py b/pyvisa_py/tcpip.py index ee153fae..6a6d04dd 100644 --- a/pyvisa_py/tcpip.py +++ b/pyvisa_py/tcpip.py @@ -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)