From f9f32c6cff2afc068a9145737362fb8b27081a71 Mon Sep 17 00:00:00 2001 From: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com> Date: Sun, 28 Jun 2020 16:08:19 +0200 Subject: [PATCH] [HOTFIX] Python module path (Windows) The pythonPath pointer was not properly enlarged when expanded. Reduced to the return of Py_DecodeLocale. This sets the correct size of the pointer at the beginning. --- libsrc/python/PythonInit.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsrc/python/PythonInit.cpp b/libsrc/python/PythonInit.cpp index ea67ee0e..761cd462 100644 --- a/libsrc/python/PythonInit.cpp +++ b/libsrc/python/PythonInit.cpp @@ -29,8 +29,7 @@ PythonInit::PythonInit() // set Python module path when exists wchar_t *pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath() + "/../lib/python")).toLatin1().data(), nullptr); #ifdef _WIN32 - pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath())).toLatin1().data(), nullptr); - pythonPath = wcscat(pythonPath, L"/python" STRINGIFY(PYTHON_VERSION_MAJOR_MINOR) ".zip"); + pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath()) + "/python" + STRINGIFY(PYTHON_VERSION_MAJOR_MINOR) ".zip").toLatin1().data(), nullptr); if(QFile(QString::fromWCharArray(pythonPath)).exists()) #else if(QDir(QString::fromWCharArray(pythonPath)).exists())