提交 21cb3d08 编写于 作者: S slzhou

fix: improve pythonpath env variable to include tsTempDir

上级 898bd0ed
...@@ -347,8 +347,16 @@ void udfdInitializePythonPlugin(SUdfScriptPlugin *plugin) { ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册