summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-27 13:01:34 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-27 13:01:34 +0900
commit347ae4ff4733f42a439cd4efb9457e7d4e2a036b (patch)
treeda92163cd1b9a3082f06949d7e9006d6c166cc5f
parent4f7f3304b16330f7112c36ef15c9d928f95e337d (diff)
downloadsphinx-git-347ae4ff4733f42a439cd4efb9457e7d4e2a036b.tar.gz
Fix #8938: imgconverter: Show the error of the command availability check
imgconverter extension suppresses an OSError like "Cannot allocate memory" unexpectedly. So the error should be shown with the warning.
-rw-r--r--CHANGES1
-rw-r--r--sphinx/ext/imgconverter.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 428b6951f..50a9ce275 100644
--- a/CHANGES
+++ b/CHANGES
@@ -64,6 +64,7 @@ Features added
* #2018: html: :confval:`html_favicon` and :confval:`html_logo` now accept URL
for the image
* #8070: html search: Support searching for 2characters word
+* #8938: imgconverter: Show the error of the command availability check
* #7830: Add debug logs for change detection of sources and templates
* #8201: Emit a warning if toctree contains duplicated entries
diff --git a/sphinx/ext/imgconverter.py b/sphinx/ext/imgconverter.py
index b0d40b551..84fe6549c 100644
--- a/sphinx/ext/imgconverter.py
+++ b/sphinx/ext/imgconverter.py
@@ -37,10 +37,10 @@ class ImagemagickConverter(ImageConverter):
logger.debug('Invoking %r ...', args)
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
return True
- except OSError:
+ except OSError as exc:
logger.warning(__('convert command %r cannot be run, '
- 'check the image_converter setting'),
- self.config.image_converter)
+ 'check the image_converter setting: %s'),
+ self.config.image_converter, exc)
return False
except CalledProcessError as exc:
logger.warning(__('convert exited with error:\n'