From 6091e12f54d6abd424f7fcfd0bfa8ba1491d0335 Mon Sep 17 00:00:00 2001 From: "Albert Y. Shih" Date: Mon, 29 Jun 2026 15:01:37 -0400 Subject: [PATCH] Backport PR #31969: Stop passing symlinks to ImageMagick --- lib/matplotlib/testing/compare.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/testing/compare.py b/lib/matplotlib/testing/compare.py index 2b94847a72b6..92547c3585f6 100644 --- a/lib/matplotlib/testing/compare.py +++ b/lib/matplotlib/testing/compare.py @@ -100,6 +100,9 @@ def _read_until(self, terminator): class _MagickConverter: def __call__(self, orig, dest): try: + # ImageMagick may not be permitted to follow a symlink, so resolve it + if orig.is_symlink(): + orig = orig.resolve() subprocess.run( [mpl._get_executable_info("magick").executable, orig, dest], check=True)