fix(server-release): 修复 MinerU 本地解析两处语法错误
1. 移除 cmd 数组中多余的 "--" 参数,导致 -p/--path 无法识别 2. finally 块中 "清理临时目录" 缺少 # 注释符,触发 NameError
This commit is contained in:
@@ -814,7 +814,6 @@ def parse_with_mineru(
|
|||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
str(mineru_exe),
|
str(mineru_exe),
|
||||||
"--",
|
|
||||||
"-p", str(file_path),
|
"-p", str(file_path),
|
||||||
"-o", str(output_dir),
|
"-o", str(output_dir),
|
||||||
"-m", "auto",
|
"-m", "auto",
|
||||||
@@ -859,7 +858,7 @@ def parse_with_mineru(
|
|||||||
logger.error(f"MinerU 解析失败: {e}")
|
logger.error(f"MinerU 解析失败: {e}")
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
清理临时目录
|
# 清理临时目录
|
||||||
if cleanup_output and os.path.exists(output_dir):
|
if cleanup_output and os.path.exists(output_dir):
|
||||||
shutil.rmtree(output_dir, ignore_errors=True)
|
shutil.rmtree(output_dir, ignore_errors=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user