mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7441 from tk0miya/7423_logging_non_string_object
Fix #7423: crashed when giving a non-string object to logger
This commit is contained in:
commit
9002b6c9ec
1
CHANGES
1
CHANGES
@ -22,6 +22,7 @@ Bugs fixed
|
|||||||
* #7418: std domain: duplication warning for glossary terms is case insensitive
|
* #7418: std domain: duplication warning for glossary terms is case insensitive
|
||||||
* #7438: C++, fix merging overloaded functions in parallel builds.
|
* #7438: C++, fix merging overloaded functions in parallel builds.
|
||||||
* #7422: autodoc: fails with ValueError when using autodoc_mock_imports
|
* #7422: autodoc: fails with ValueError when using autodoc_mock_imports
|
||||||
|
* #7423: crashed when giving a non-string object to logger
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -412,7 +412,7 @@ class WarningIsErrorFilter(logging.Filter):
|
|||||||
message = record.msg # use record.msg itself
|
message = record.msg # use record.msg itself
|
||||||
|
|
||||||
if location:
|
if location:
|
||||||
raise SphinxWarning(location + ":" + message)
|
raise SphinxWarning(location + ":" + str(message))
|
||||||
else:
|
else:
|
||||||
raise SphinxWarning(message)
|
raise SphinxWarning(message)
|
||||||
else:
|
else:
|
||||||
|
@ -48,6 +48,14 @@ def test_info_and_warning(app, status, warning):
|
|||||||
assert 'message5' in warning.getvalue()
|
assert 'message5' in warning.getvalue()
|
||||||
|
|
||||||
|
|
||||||
|
def test_Exception(app, status, warning):
|
||||||
|
logging.setup(app, status, warning)
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
logger.info(Exception)
|
||||||
|
assert "<class 'Exception'>" in status.getvalue()
|
||||||
|
|
||||||
|
|
||||||
def test_verbosity_filter(app, status, warning):
|
def test_verbosity_filter(app, status, warning):
|
||||||
# verbosity = 0: INFO
|
# verbosity = 0: INFO
|
||||||
app.verbosity = 0
|
app.verbosity = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user