Fix #5007: sphinx-build crashes when error log contains a "%" character

This commit is contained in:
Takeshi KOMIYA 2018-05-24 01:46:16 +09:00
parent 1b5bc55956
commit 9d1d48fb60
2 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@ Bugs fixed
* #4980: latex: Explicit labels on code blocks are duplicated * #4980: latex: Explicit labels on code blocks are duplicated
* #4919: node.asdom() crashes if toctree has :numbered: option * #4919: node.asdom() crashes if toctree has :numbered: option
* #4914: autodoc: Parsing error when using dataclasses without default values * #4914: autodoc: Parsing error when using dataclasses without default values
* #5007: sphinx-build crashes when error log contains a "%" character
Testing Testing
-------- --------

View File

@ -373,7 +373,7 @@ class WarningIsErrorFilter(logging.Filter):
location = getattr(record, 'location', '') location = getattr(record, 'location', '')
try: try:
message = record.msg % record.args message = record.msg % record.args
except TypeError: except (TypeError, ValueError):
message = record.msg # use record.msg itself message = record.msg # use record.msg itself
if location: if location: