windows上subprocess.Popen的参数close_fds=True与stdin/stdout/stderr不能共存
2017-03-21 21:53
537 查看
运行命令
出现错误
原因
close_fds=True表示子进程将不会继承父进程的输入、输出、错误管道。
windows上不能将close_fds设置为True同时重定向子进程的标准输入、输出与错误(stdin, stdout, stderr)
subprocess.Popen(cmd, close_fds=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
出现错误
ValueError: close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr
原因
在windows上subprocess.Popen的参数close_fds=True与stdin/stdout/stderr不能共存
close_fds=True表示子进程将不会继承父进程的输入、输出、错误管道。
windows上不能将close_fds设置为True同时重定向子进程的标准输入、输出与错误(stdin, stdout, stderr)
相关文章推荐
- 怎样在windows环境中启动某控制台程序并改变它的stdin、stdout和stderr? http://book.77169.org/ask18/how106297.htm
- subprocess.Popen() 必须加上close_fds=True
- subprocess.Popen() 必须加上close_fds=True(
- (转)Windows管道(Pipe)重定向stdout,stderr,stdin
- Windows管道(Pipe)重定向stdout,stderr,stdin
- python subprocess参数shell=True踩到的坑
- windows下python subprocess.Popen执行adb 命令进程无法终止
- Windows管道(Pipe)重定向stdout,stderr,stdin
- Windows管道(Pipe)重定向stdout,stderr,stdin
- subprocess.popen.kill杀死所有子进程
- 如何将stdin、stdout、stderr重定向到/dev/null
- 有时需要关闭stdin、stdout、stderr
- subprocess的实例不能pickle
- C程序(scanf函数应用、字符串中取小数、两文件COPY、指针操作、stdout、stdin、stderr、sscanf、sprintf函数)
- Linux守护进程的stdout, stdin, stderr
- 使用 subprocess.Popen 创建子进程
- stdin,stdout,stderr
- Linux 下 stdin stdout stderr 的由来
- Linux下如何重新打开标准输入输出(stdin,stdout,stderr)
- [windows编程]error C2664: “MessageBoxW”: 不能将参数 2 从“char *”转换为“LPCWSTR”