我的python文件运行正常
import patoolib patoolib.extract_archive("test.7z")
但是当我使用pyinstaller在windows上制作可执行文件时,我得到了这个错误:
Traceback (most recent call last):
File "patol.py", line 2, in <module>
patoolib.extract_archive("test.7z")
File "patoolib__init__.py", line 684, in extract_archive
return _extract_archive(archive, verbosity=verbosity, interactive=interactive, outdir=outdir, program=program)
File "patoolib__init__.py", line 484, in _extract_archive
run_archive_cmdlist(cmdlist, verbosity=verbosity)
File "patoolib__init__.py", line 421, in run_archive_cmdlist
return util.run_checked(cmdlist, verbosity=verbosity, **runkwargs)
File "patoolibutil.py", line 224, in run_checked
retcode = run(cmd, **kwargs)
File "patoolibutil.py", line 216, in run
res = subprocess.call(cmd, **kwargs)
File "subprocess.py", line 349, in call
File "subprocess.py", line 829, in __init__
File "subprocess.py", line 1252, in _get_handles
OSError: [WinError 6] Descripteur non valide
帮助请
添加:
kwargs['stdin'] =subprocess.PIPE
kwargs['sterr'] =subprocess.STDOUT
:Python39-32Libsite-packagespatoolibutil.py
(第215至217行)