Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the exception when logging PO/MO file read/write #4147

Merged
merged 2 commits into from
Oct 13, 2017
Merged

Include the exception when logging PO/MO file read/write #4147

merged 2 commits into from
Oct 13, 2017

Conversation

ideasman42
Copy link
Contributor

Without this there is no way to troubleshoot why (read/write)_po fails.

Our project ran into an error where all translations fail, there was no simple way to find out why, without local edits to i18n.py

Subject: log exception messages

Feature or Bugfix

  • Feature

Purpose

  • Help troubleshoot errors

Detail

None.

Without this there is no way to troubleshoot why (read/write)_po fails.
@ideasman42 ideasman42 changed the title Include the exception when logging Include the exception when logging PO/MO file read/write Oct 13, 2017
Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this it would be nice if this change will be included in 1.6.5.
So could you rebase this to stable branch?

@@ -67,15 +67,15 @@ def write_mo(self, locale):
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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this project, we usually use exc or err for variable name. Could you rename this to exc please?

@tk0miya tk0miya added this to the 1.6.5 milestone Oct 13, 2017
@ideasman42
Copy link
Contributor Author

Update with requested changes

@tk0miya tk0miya merged commit f746959 into sphinx-doc:master Oct 13, 2017
@tk0miya
Copy link
Member

tk0miya commented Oct 13, 2017

Thank you for contribution and your quick response!

tk0miya added a commit that referenced this pull request Oct 13, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants