好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

subprocess execv() arg 2 must contain only strings

subprocess 调用的cmd中含有中文,如下 cmd="\cp -f %s %s"%(x, y),y是前台传入的中文参数 调用Popen导致如下错误: execv() arg 2 must contain only strings

如下修改: subprocess.Popen(cmd.encode('utf-8'), shell=True)

查看更多关于subprocess execv() arg 2 must contain only strings的详细内容...

  阅读:22次