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 stringsshell

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

相关文章
相关标签/搜索