Closed magic-akari closed 1 month ago
感谢您的代码贡献!经测试下来,发现当python路径存在空格时,使用PYTHON=sys.executable
,执行重启webui命令时存在bug:
(base) E:\vs\MSST: can't open file 'E:\\vs\\MSST WebUI\\WebUI\\workenv\\python.exe': [Errno 2] No such file or directory
此错误会影响到将此程序安装在Program Files
路径下的用户
现已将此行代码修改至
PYTHON = ".\\workenv\\python.exe" if os.path.isfile(".\\workenv\\python.exe") else sys.executable
如果是这样的话,在其他系统上,如果 python 路径带空格(虽然不太可能)也可能面临同样的问题。
我觉得需要重新考虑一下 subprocess.run
的传参方式。
Thank you for your contribution!