disable exc masking

This commit is contained in:
2025-08-16 19:03:13 +02:00
parent c49615aab6
commit 6dc4c9d1b3
2 changed files with 12 additions and 8 deletions
+4 -4
View File
@@ -30,7 +30,7 @@ def is_tex_attachment(att, max_mb: int) -> bool:
async def run_latex_two_passes(
tex_filename: str, workdir: Path, tex_engine: str, timeout_sec: int, logger=None
tex_filename: str, workdir: Path, tex_engine: str, timeout_sec: int, logger:str=None
) -> Tuple[bool, str, Path]:
cmd = f"{tex_engine} -interaction=nonstopmode -halt-on-error -file-line-error -no-shell-escape {shlex.quote(tex_filename)}"
logger = logging.getLogger(logger) if logger else None
@@ -52,7 +52,7 @@ async def run_latex_two_passes(
try:
proc.kill()
except Exception:
pass
raise
return 124, f"[Timeout] Compilation exceeded {timeout_sec}s.\n"
logs: List[str] = []
@@ -75,7 +75,7 @@ async def run_latex_two_passes(
async def compile_single_tex_bytes(
tex_bytes: bytes, filename: str, tex_engine: str, timeout_sec: int, logger=None
tex_bytes: bytes, filename: str, tex_engine: str, timeout_sec: int, logger:str=None
) -> Dict[str, Optional[object]]:
if not is_safe_tex_name(filename):
return {
@@ -107,7 +107,7 @@ async def compile_single_tex_bytes(
async def compile_zip_to_zip(
zip_bytes: bytes, tex_engine: str, timeout_sec: int, logger=None
zip_bytes: bytes, tex_engine: str, timeout_sec: int, logger:str=None
) -> Tuple[bytes, List[str]]:
failed: List[str] = []
out_pdf_paths: List[Path] = []