Closed
Description
Describe the bug
TypeError in sphinx logging building CPython docs with Sphinx 3.0
To Reproduce
Steps to reproduce the behavior:
$ git clone --depth 1 https://github.com/python/cpython/
$ cd cpython/Doc
$ Edit Makefile to ensure it's not pinned to 2.2 at https://github.com/python/cpython/blob/38aefc585f60a77d66f4fbe5a37594a488b53474/Doc/Makefile#L146
$ make venv
$ make html
Expected behavior
No internal error
Error log
# Sphinx version: 3.0.0
# Python version: 3.8.0 (CPython)
# Docutils version: 0.16 release
# Jinja2 version: 2.11.1
# Last messages:
# reading sources... [ 98%] whatsnew/3.3
# reading sources... [ 98%] whatsnew/3.4
# reading sources... [ 98%] whatsnew/3.5
# reading sources... [ 98%] whatsnew/3.6
# reading sources... [ 99%] whatsnew/3.7
# reading sources... [ 99%] whatsnew/3.8
# reading sources... [ 99%] whatsnew/3.9
# reading sources... [ 99%] whatsnew/changelog
# reading sources... [100%] whatsnew/index
#
# Loaded extensions:
# sphinx.ext.mathjax (3.0.0) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/ext/mathjax.py
# sphinxcontrib.applehelp (1.0.2) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py
# sphinxcontrib.devhelp (1.0.2) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinxcontrib/devhelp/__init__.py
# sphinxcontrib.htmlhelp (1.0.3) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinxcontrib/htmlhelp/__init__.py
# sphinxcontrib.serializinghtml (1.1.4) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinxcontrib/serializinghtml/__init__.py
# sphinxcontrib.qthelp (1.0.3) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinxcontrib/qthelp/__init__.py
# alabaster (0.7.12) from /root/cpython/Doc/venv/lib/python3.8/site-packages/alabaster/__init__.py
# sphinx.ext.coverage (3.0.0) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/ext/coverage.py
# sphinx.ext.doctest (3.0.0) from /root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/ext/doctest.py
# pyspecific (1.0) from /root/cpython/Doc/tools/extensions/pyspecific.py
# c_annotations (1.0) from /root/cpython/Doc/tools/extensions/c_annotations.py
# escape4chm (1.0) from /root/cpython/Doc/tools/extensions/escape4chm.py
# python_docs_theme (unknown version) from /root/cpython/Doc/venv/lib/python3.8/site-packages/python_docs_theme/__init__.py
Traceback (most recent call last):
File "/root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "/root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/application.py", line 348, in build
self.builder.build_update()
File "/root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 297, in build_update
self.build(to_build,
File "/root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 311, in build
updated_docnames = set(self.read())
File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__
next(self.gen)
File "/root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/util/logging.py", line 213, in pending_warnings
memhandler.flushTo(logger)
File "/root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/util/logging.py", line 178, in flushTo
logger.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1587, in handle
self.callHandlers(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1649, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 946, in handle
rv = self.filter(record)
File "/usr/lib/python3.8/logging/__init__.py", line 807, in filter
result = f.filter(record)
File "/root/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/util/logging.py", line 415, in filter
raise SphinxWarning(location + ":" + message)
TypeError: can only concatenate str (not "DefinitionError") to str
Environment info
- OS: Linux
- Python version: 3.8
- Sphinx version: 3.0
- Sphinx extensions: listed in the error log
Additional context
Cpython issue : https://bugs.python.org/issue40204