From ab2d7a953d0ee6c2dfece573ad9114702e84d923 Mon Sep 17 00:00:00 2001 From: "Lorenzo M." Date: Tue, 15 Oct 2024 20:40:34 +0200 Subject: [PATCH 1/2] fix: issue 351 - deleted EOF control in telnet sync/async control chars --- scrapli/transport/plugins/asynctelnet/transport.py | 3 --- scrapli/transport/plugins/telnet/transport.py | 3 --- 2 files changed, 6 deletions(-) diff --git a/scrapli/transport/plugins/asynctelnet/transport.py b/scrapli/transport/plugins/asynctelnet/transport.py index 4e617518..3c755c26 100644 --- a/scrapli/transport/plugins/asynctelnet/transport.py +++ b/scrapli/transport/plugins/asynctelnet/transport.py @@ -117,9 +117,6 @@ def _handle_control_chars(self) -> None: if not self.stdout: raise ScrapliConnectionNotOpened - if self._raw_buf.find(NULL) != -1: - raise ScrapliConnectionNotOpened("server returned EOF, connection not opened") - index = self._raw_buf.find(IAC) if index == -1: self._cooked_buf = self._raw_buf diff --git a/scrapli/transport/plugins/telnet/transport.py b/scrapli/transport/plugins/telnet/transport.py index 05d6fcaa..517289e8 100644 --- a/scrapli/transport/plugins/telnet/transport.py +++ b/scrapli/transport/plugins/telnet/transport.py @@ -148,9 +148,6 @@ def _handle_control_chars(self) -> None: if not self.socket: raise ScrapliConnectionNotOpened - if self._raw_buf.find(NULL) != -1: - raise ScrapliConnectionNotOpened("server returned EOF, connection not opened") - index = self._raw_buf.find(IAC) if index == -1: self._cooked_buf = self._raw_buf From e18ad73f13057b8ea513731cf3c05fc1e2cda1e9 Mon Sep 17 00:00:00 2001 From: "Lorenzo M." Date: Tue, 15 Oct 2024 20:56:36 +0200 Subject: [PATCH 2/2] fix: deleted EOF control in telnet sync/async control chars --- scrapli/transport/plugins/asynctelnet/transport.py | 2 -- scrapli/transport/plugins/telnet/transport.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/scrapli/transport/plugins/asynctelnet/transport.py b/scrapli/transport/plugins/asynctelnet/transport.py index 3c755c26..a9673e6f 100644 --- a/scrapli/transport/plugins/asynctelnet/transport.py +++ b/scrapli/transport/plugins/asynctelnet/transport.py @@ -110,8 +110,6 @@ def _handle_control_chars(self) -> None: Raises: ScrapliConnectionNotOpened: if connection is not opened for some reason - ScrapliConnectionNotOpened: if we read an empty byte string from the reader -- this - indicates the server sent an EOF -- see #142 """ if not self.stdout: diff --git a/scrapli/transport/plugins/telnet/transport.py b/scrapli/transport/plugins/telnet/transport.py index 517289e8..4229f719 100644 --- a/scrapli/transport/plugins/telnet/transport.py +++ b/scrapli/transport/plugins/telnet/transport.py @@ -141,8 +141,6 @@ def _handle_control_chars(self) -> None: Raises: ScrapliConnectionNotOpened: if connection is not opened for some reason - ScrapliConnectionNotOpened: if we read an empty byte string from the reader -- this - indicates the server sent an EOF -- see #142 """ if not self.socket: