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

Sphinx crashes if unknown po file exists #5399

Closed
tk0miya opened this issue Sep 8, 2018 · 1 comment
Closed

Sphinx crashes if unknown po file exists #5399

tk0miya opened this issue Sep 8, 2018 · 1 comment

Comments

@tk0miya
Copy link
Member

tk0miya commented Sep 8, 2018

Problem

  • Sphinx crashes if unknown po file exists

Procedure to reproduce the problem

$  sphinx-quickstart -q -aa -pp test
$  cd test
$  mkdir -p locales/en/LC_MESSAGES/sphinx
$  touch locales/en/LC_MESSAGES/sphinx/index.po
$  make html SPHINXOPTS='-D language=en'

Error logs / results

# Sphinx version: 2.0.0+
# Python version: 3.6.5 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
#   loading translations [en]...
#
#   done
#
#   making output directory...
#
#   building [mo]: targets for 1 po files that are out of date
#
#   writing output... [100%] locales/en/LC_MESSAGES/sphinx.mo
#
# Loaded extensions:
#   sphinx.ext.mathjax (2.0.0+) from /Users/tkomiya/work/sphinx/sphinx/ext/mathjax.py
#   alabaster (0.7.10) from /Users/tkomiya/work/tmp/lib/python3.6/site-packages/alabaster-0.7.10-py3.6.egg/alabaster/__init__.py
Traceback (most recent call last):
  File "/Users/tkomiya/work/sphinx/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
  File "/Users/tkomiya/work/sphinx/sphinx/application.py", line 340, in build
    self.builder.compile_update_catalogs()
  File "/Users/tkomiya/work/sphinx/sphinx/builders/__init__.py", line 281, in compile_update_catalogs
    self.compile_catalogs(catalogs, message)
  File "/Users/tkomiya/work/sphinx/sphinx/builders/__init__.py", line 236, in compile_catalogs
    catalog.write_mo(self.config.language)
  File "/Users/tkomiya/work/sphinx/sphinx/util/i18n.py", line 71, in write_mo
    with io.open(self.po_path, 'rt', encoding=self.charset) as file_po:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/tkomiya/work/tmp/doc/test/locales/en/LC_MESSAGES/sphinx.po'

Expected results

Sphinx skips them and goes builds fine.

Environment info

  • OS: Mac
  • Python version: 3.7.0
  • Sphinx version: 2.0.0+
@tk0miya tk0miya added this to the 1.8.0 milestone Sep 8, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this issue Sep 8, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this issue Sep 8, 2018
tk0miya added a commit that referenced this issue Sep 9, 2018
Fix #5399: Sphinx crashes if unknown po file exists
@tk0miya
Copy link
Member Author

tk0miya commented Sep 9, 2018

Fixed by #5400.

@tk0miya tk0miya closed this as completed Sep 9, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant