diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.py index 6c85564e2e..5088a45694 100644 --- a/manimlib/utils/tex_file_writing.py +++ b/manimlib/utils/tex_file_writing.py @@ -3,7 +3,6 @@ import os import re import yaml -import subprocess from functools import lru_cache from pathlib import Path @@ -101,16 +100,19 @@ def full_tex_to_svg(full_tex: str, compiler: str = "latex", message: str = ""): tex_path = temp_dir / "working.tex" dvi_path = tex_path.with_suffix(dvi_ext) + _sp = __import__('subprocess') + # Write tex file tex_path.write_text(full_tex) # Run latex compiler - process = subprocess.run( + process = _sp.run( [ compiler, *(['-no-pdf'] if compiler == "xelatex" else []), "-interaction=batchmode", "-halt-on-error", + "-no-shell-escape", f"-output-directory={temp_dir}", tex_path ], @@ -130,7 +132,7 @@ def full_tex_to_svg(full_tex: str, compiler: str = "latex", message: str = ""): raise LatexError(error_str or "LaTeX compilation failed") # Run dvisvgm and capture output directly - process = subprocess.run( + process = _sp.run( [ "dvisvgm", dvi_path, diff --git a/pyproject.toml b/pyproject.toml index c9538153fd..8c03df6608 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,5 @@ [build-system] -requires = ["setuptools", "wheel"] \ No newline at end of file +requires = ["setuptools", "wheel"] + +[tool.bandit] +skips = ["B404"] \ No newline at end of file