Skip to content

Commit

Permalink
Fixes type error when decoding invalid Netconf data
Browse files Browse the repository at this point in the history
Fixes issue #1254
  • Loading branch information
monnierj committed Aug 1, 2023
1 parent a106028 commit 3a5060f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/jnpr/junos/transport/tty_netconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def open(self, at_shell):
raise RuntimeError("Error: netconf not responding")

self.hello = self._receive()
self._session_id, _ = HelloHandler.parse(self.hello.decode("utf-8"))
self._session_id, _ = HelloHandler.parse(
self.hello.decode("utf-8") if isinstance(self.hello, bytes)
else self.hello
)

def close(self, force=False):
"""issue the XML API to close the session"""
Expand Down

0 comments on commit 3a5060f

Please sign in to comment.