From ae3e39a54677c39484e7d7472ade633b578bdebc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 13 Oct 2017 16:10:44 +1100 Subject: [PATCH] Include the exception when logging Without this there is no way to troubleshoot why (read/write)_po fails. --- sphinx/util/i18n.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sphinx/util/i18n.py b/sphinx/util/i18n.py index 218fac163..a8c0bc555 100644 --- a/sphinx/util/i18n.py +++ b/sphinx/util/i18n.py @@ -67,15 +67,15 @@ class CatalogInfo(LocaleFileInfoBase): with io.open(self.po_path, 'rt', encoding=self.charset) as file_po: try: po = read_po(file_po, locale) - except Exception: - logger.warning('reading error: %s', self.po_path) + except Exception as ex: + logger.warning('reading error: %s, %s', self.po_path, ex) return with io.open(self.mo_path, 'wb') as file_mo: try: write_mo(file_mo, po) - except Exception: - logger.warning('writing error: %s', self.mo_path) + except Exception as ex: + logger.warning('writing error: %s, %s', self.mo_path, ex) def find_catalog(docname, compaction):