Merge branch '1.8'

This commit is contained in:
Takeshi KOMIYA committed 2018-12-18 23:32:52 +09:00
commit 3905cb8b7c
9 files changed
+31 -7

No files matched your search

+2
View File
@@ -149,6 +149,7 @@ Features added
Bugs fixed
----------
* #5725: mathjax: Use CDN URL for "latest" version by default
* #5460: html search does not work with some 3rd party themes
* #5520: LaTeX, caption package incompatibility since Sphinx 1.6
* #5614: autodoc: incremental build is broken when builtin modules are imported
@@ -159,6 +160,7 @@ Bugs fixed
(refs: #1238)
* #5636: C++, fix parsing of floating point literals.
* #5496 (again): C++, fix assertion in partial builds with duplicates.
* #5724: quickstart: sphinx-quickstart fails when $LC_ALL is empty
Testing
--------
+1 -1
View File
@@ -292,7 +292,7 @@ def build_main(argv=sys.argv[1:]):
def main(argv=sys.argv[1:]):
# type: (List[str]) -> int
locale.setlocale(locale.LC_ALL, '')
sphinx.locale.setlocale(locale.LC_ALL, '')
sphinx.locale.init_console(os.path.join(package_dir, 'locale'), 'sphinx')
if argv[:1] == ['-M']:
+1 -1
View File
@@ -596,7 +596,7 @@ Makefile to be used with sphinx-build.
def main(argv=sys.argv[1:]):
# type: (List[str]) -> int
locale.setlocale(locale.LC_ALL, '')
sphinx.locale.setlocale(locale.LC_ALL, '')
sphinx.locale.init_console(os.path.join(package_dir, 'locale'), 'sphinx')
if not color_terminal():
+1 -1
View File
@@ -382,7 +382,7 @@ Note: By default this script will not overwrite already created files."""))
def main(argv=sys.argv[1:]):
# type: (List[str]) -> int
"""Parse and check the command line arguments."""
locale.setlocale(locale.LC_ALL, '')
sphinx.locale.setlocale(locale.LC_ALL, '')
sphinx.locale.init_console(os.path.join(package_dir, 'locale'), 'sphinx')
parser = get_parser()
+1 -1
View File
@@ -403,7 +403,7 @@ The format of the autosummary directive is documented in the
def main(argv=sys.argv[1:]):
# type: (List[str]) -> None
locale.setlocale(locale.LC_ALL, '')
sphinx.locale.setlocale(locale.LC_ALL, '')
sphinx.locale.init_console(os.path.join(package_dir, 'locale'), 'sphinx')
app = DummyApplication()
+1 -1
View File
@@ -103,7 +103,7 @@ def setup(app):
# more information for mathjax secure url is here:
# https://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn
app.add_config_value('mathjax_path',
'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?'
'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?'
'config=TeX-AMS-MML_HTMLorMML', 'html')
app.add_config_value('mathjax_options', {}, 'html')
app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
+22 -1
View File
@@ -20,7 +20,7 @@ from sphinx.deprecation import RemovedInSphinx30Warning
if False:
# For type annotation
from typing import Any, Callable, Dict, Iterator, List, Tuple # NOQA
from typing import Any, Callable, Dict, Iterable, Iterator, List, Tuple, Union # NOQA
class _TranslationProxy(UserString):
@@ -192,6 +192,27 @@ def init(locale_dirs, language, catalog='sphinx', namespace='general'):
return translator, has_translation
def setlocale(category, value=None):
# type: (int, Union[str, Iterable[str]]) -> None
"""Update locale settings.
This does not throw any exception even if update fails.
This is workaround for Python's bug.
For more details:
* https://github.com/sphinx-doc/sphinx/issues/5724
* https://bugs.python.org/issue18378#msg215215
.. note:: Only for internal use. Please don't call this method from extensions.
This will be removed in future.
"""
try:
locale.setlocale(category, value)
except locale.Error:
pass
def init_console(locale_dir, catalog):
# type: (str, str) -> Tuple[NullTranslations, bool]
"""Initialize locale for console.
+1
View File
@@ -65,6 +65,7 @@ def compile_latex_document(app):
copyfile('SphinxTests.tex',
app.config.latex_engine + '/SphinxTests.tex')
p = Popen([app.config.latex_engine,
'--halt-on-error',
'--interaction=nonstopmode',
'-output-directory=%s' % app.config.latex_engine,
'SphinxTests.tex'],
+1 -1
View File
@@ -94,7 +94,7 @@ def test_mathjax_options(app, status, warning):
content = (app.outdir / 'index.html').text()
assert ('<script async="async" integrity="sha384-0123456789" type="text/javascript" '
'src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?'
'src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?'
'config=TeX-AMS-MML_HTMLorMML"></script>' in content)