From 94053f8c9dbebdf414f09c25edeb3e8f1a302b43 Mon Sep 17 00:00:00 2001 From: Joe Hultgren Date: Fri, 22 Jan 2021 14:49:23 -0800 Subject: [PATCH] Only try to encode strings If encoding is set on the connection it was no longer able to accept ints to commands. --- P4.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/P4.py b/P4.py index d5491fe..bb56605 100755 --- a/P4.py +++ b/P4.py @@ -595,7 +595,10 @@ def run(self, *args, **kargs): if hasattr(self,"encoding") and self.encoding and not self.encoding == 'raw': result = [] for s in flatArgs: - result.append( s.encode(self.encoding) ) + if isinstance(s, str): + result.append( s.encode(self.encoding) ) + else: + result.append(s) flatArgs = result if self.logger: