From fcdeb46a14220788c53343e6d356990a7c809156 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Mon, 3 Feb 2025 15:24:22 +0100 Subject: [PATCH] Ignore ImageMagick deprecation of "convert" command. Ignoring the deprecation warning (present since IM 7.1.1-33, May 2024) is the quickest fix. The proper fix would be to switch to using "magick" everywhere but the command's syntax is a bit different and the CLI usage thus needs to be verified; moreover this would break users with very old installs of imagemagick (unless adding some version sniffing code) although IMv7 has been out since 2016 so that is likely acceptable. (That proper fix likely also needs some fiddling around the special-casing of `rcParams["animation.convert_path"] = "convert"` in ImageMagickBase.bin_path; e.g. should the rcParams be renamed to `"animation.magick_path"` and have "magick" be the special case...) --- lib/matplotlib/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 5f964e0b34de..56c76c58acf1 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -474,7 +474,8 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False): "Failed to find an ImageMagick installation") else: path = "convert" - info = impl([path, "--version"], r"^Version: ImageMagick (\S*)") + # Ignore deprecation warning for "convert" on IM>=7.1.1-33. + info = impl([path, "--version"], r"(?sm:.*^)Version: ImageMagick (\S*)") if info.raw_version == "7.0.10-34": # https://github.com/ImageMagick/ImageMagick/issues/2720 raise ExecutableNotFoundError(