subprocess.Popen() 跑完不能正常关闭端口
作者:
tafanfly | 来源:发表于
2018-08-28 16:21 被阅读0次背景,用下面的命令, 端口不能正常关闭
- python 中使用 subprocess.Popen()
- robotframework 中使用 start process, 本质上其实用到的还是 subprocess.Popen()
解决
- 如果是python, 记得 subprocess.Popen() 必须加上close_fds=True
process = subprocess.Popen(command, close_fds=True, **conf.popen_config)
- 如果是robotframework 的 start process, 需要修改/robot/libraries 下的process 文件, 给subprocess.Popen() 加上参数 close_fds=True
python -c 'import robot; print robot.libraries.__path__[0]'
/home/***/.local/lib/python2.7/site-packages/robot/libraries
本文标题:subprocess.Popen() 跑完不能正常关闭端口
本文链接:https://www.haomeiwen.com/subject/yjkqwftx.html
网友评论