diff --git a/lib/matplotlib/testing/compare.py b/lib/matplotlib/testing/compare.py index e712dd05c360..0a2ae17b36d0 100644 --- a/lib/matplotlib/testing/compare.py +++ b/lib/matplotlib/testing/compare.py @@ -92,7 +92,7 @@ def _read_until(self, terminator): while True: c = self._proc.stdout.read(1) if not c: - raise _ConverterError + raise _ConverterError(os.fsdecode(bytes(buf))) buf.extend(c) if buf.endswith(terminator): return bytes(buf) @@ -109,7 +109,8 @@ def __call__(self, orig, dest): try: self._read_until(b"\nGS") except _ConverterError as err: - raise OSError("Failed to start Ghostscript") from err + raise OSError( + "Failed to start Ghostscript:\n\n" + err.args[0]) from None def encode_and_escape(name): return (os.fsencode(name) @@ -172,8 +173,9 @@ def __call__(self, orig, dest): try: self._read_until(terminator) except _ConverterError as err: - raise OSError("Failed to start Inkscape in interactive " - "mode") from err + raise OSError( + "Failed to start Inkscape in interactive mode:\n\n" + + err.args[0]) from err # Inkscape's shell mode does not support escaping metacharacters in the # filename ("\n", and ":;" for inkscape>=1). Avoid any problems by