diff --git a/client/src/UDSClient.py b/client/src/UDSClient.py index ab4f7de9..b3ed5592 100755 --- a/client/src/UDSClient.py +++ b/client/src/UDSClient.py @@ -143,6 +143,7 @@ class UDSClient(QtGui.QMainWindow): @QtCore.pyqtSlot(dict) def transportDataReceived(self, data): + logger.debug('Transport data received') try: self.processError(data) @@ -166,6 +167,7 @@ class UDSClient(QtGui.QMainWindow): QtCore.QTimer.singleShot(10000, self.getTransportData) except Exception as e: + logger.exception('Got exception executing script:') self.showError(e) def endScript(self): diff --git a/client/src/uds/log.py b/client/src/uds/log.py index eead369b..1c9eacc4 100644 --- a/client/src/uds/log.py +++ b/client/src/uds/log.py @@ -36,7 +36,7 @@ import os import tempfile logging.basicConfig( - filename=os.path.join(tempfile.gettempdir(), 'udsclient.log'), + filename=os.path.join(tempfile.gettempdir(), b'udsclient.log'), filemode='a', format='%(levelname)s %(asctime)s %(message)s', level=logging.INFO diff --git a/client/src/uds/tools.py b/client/src/uds/tools.py index 21314cb8..82a1908d 100644 --- a/client/src/uds/tools.py +++ b/client/src/uds/tools.py @@ -39,6 +39,7 @@ import os import socket import stat import six +import sys _unlinkFiles = [] _tasksToWait = [] @@ -49,6 +50,8 @@ def saveTempFile(content, filename=None): if filename is None: filename = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16)) filename = filename + '.uds' + if 'win32' in sys.platform: + filename = filename.encode('utf-8') filename = os.path.join(tempfile.gettempdir(), filename) with open(filename, 'w') as f: f.write(content) @@ -57,6 +60,8 @@ def saveTempFile(content, filename=None): def findApp(appName, extraPath=None): + if 'win32' in sys.platform and isinstance(appName, six.text_type): + appName = six.binary_type(appName) searchPath = os.environ['PATH'].split(os.pathsep) if extraPath is not None: searchPath += list(extraPath)