[Autotest][PY3] Fixing logging_config for py3 compatibility

The autoconversion of this file is not py3 compatible. Encoding unicode
in python3 results in a byte, which is not logging compatible. This
check looks like its there to turn unicode to str in py2, to support
logging. Py3 this is not needed, so lets guard the check with a python
version check.

BUG=chromium:990593
TEST= A FAILING test in py3 and py2, where the error was found.

Change-Id: I9495c3afd4aa6aba21e1c6bc26ccb8b564ae46ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2582239
Tested-by: Derek Beckett <dbeckett@chromium.org>
Auto-Submit: Derek Beckett <dbeckett@chromium.org>
Reviewed-by: Gregory Nisbet <gregorynisbet@google.com>
Commit-Queue: Gregory Nisbet <gregorynisbet@google.com>
diff --git a/client/common_lib/logging_config.py b/client/common_lib/logging_config.py
index 5c6c830..85b8cee 100644
--- a/client/common_lib/logging_config.py
+++ b/client/common_lib/logging_config.py
@@ -42,7 +42,11 @@
         # On Brillo the logger binary is not available. Disable after error.
         if self._should_respew:
             try:
-                if isinstance(s, six.text_type):
+                # in python2 unicode != string, so encode the record into a
+                # string for logging. In py3 this is just not needed.
+                # Additionally, encoding in py3 results in bytes, which breaks
+                # logging.
+                if six.PY2 and isinstance(s, unicode):
                     s = s.encode('utf8')
                 os.system('logger -t "autotest" "%s"' % utils.sh_escape(s))
             except OSError: