fix: improve pythonpath env variable to include tsTempDir
This commit is contained in:
parent
898bd0ed33
commit
21cb3d0821
|
@ -347,8 +347,16 @@ void udfdInitializePythonPlugin(SUdfScriptPlugin *plugin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plugin->openFunc) {
|
if (plugin->openFunc) {
|
||||||
SScriptUdfEnvItem items[] ={{"PYTHONPATH", tsUdfdLdLibPath}};
|
int16_t lenPythonPath = strlen(tsUdfdLdLibPath) + strlen(tsTempDir) + 1 + 1; //tsTempDir:tsUdfdLdLibPath
|
||||||
|
char* pythonPath= taosMemoryMalloc(lenPythonPath);
|
||||||
|
#ifdef WINDOWS
|
||||||
|
snprintf(pythonPath, lenPythonPath, "%s;%s", tsTempDir, tsUdfdLdLibPath);
|
||||||
|
#else
|
||||||
|
snprintf(pythonPath, lenPythonPath, "%s:%s", tsTempDir, tsUdfdLdLibPath);
|
||||||
|
#endif
|
||||||
|
SScriptUdfEnvItem items[] ={{"PYTHONPATH", pythonPath}};
|
||||||
plugin->openFunc(items, 1);
|
plugin->openFunc(items, 1);
|
||||||
|
taosMemoryFree(pythonPath);
|
||||||
}
|
}
|
||||||
plugin->libLoaded = true;
|
plugin->libLoaded = true;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue