Python 为什么子流程在给定任务期间失败?

Python 为什么子流程在给定任务期间失败?,python,asynchronous,async-await,operating-system,subprocess,Python,Asynchronous,Async Await,Operating System,Subprocess,我使用subprocess而不是os.system来执行shell命令,将文档异步转换为pdf。重复调用时,大约50%的文件会失败。它不会将文档文件转换为pdf。我怎样才能修好它 conversion_process = await asyncio.create_subprocess_shell( 'soffice -env:UserInstallation=file:///tmp/LibreOffice_Conversion_' + author + ' --headless --conve

我使用subprocess而不是os.system来执行shell命令,将文档异步转换为pdf。重复调用时,大约50%的文件会失败。它不会将文档文件转换为pdf。我怎样才能修好它

conversion_process = await asyncio.create_subprocess_shell( 'soffice -env:UserInstallation=file:///tmp/LibreOffice_Conversion_' + author  + ' --headless --convert-to pdf --outdir ' + folder + ' ' + input_file, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = await conversion_process.communicate()
   if stderr:
       app.logger.error(f"stderr: {stderr}")
错误消息:

stderr: b'javaldx: Could not find a Java Runtime Environment!
Please ensure that a JVM and the package libreoffice-java-common
is installed.
If it is already installed then try removing ~/.config/libreoffice/4/user/config/javasettings_Linux_*.xml
Warning: failed to read path from javaldx

你能为我分享一下错误信息吗failure@PouyaEsmaeili,我在上面的问题中添加了错误消息。@PouyaEsmaeili,但我怀疑,如果上面提到的错误消息是原因,那么其他命令为什么会成功执行。他们也应该抛出这个错误。