Repository navigation
Another invalid JSON in #102582
Copy link
Copy link
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Documentation
When building the documentation for Python 3.10.10 (with Sphinx 4.2.0), the process build with this error:
[ 143s] Warning, treated as error:
[ 143s] /home/abuild/rpmbuild/BUILD/Python-3.10.10/Doc/howto/logging-cookbook.rst:341:Could not lex literal_block as "json". Highlighting skipped.
[ 144s] make: *** [Makefile:52: build] Error 2
[ 144s] error: Bad exit status from /var/tmp/rpm-tmp.wHpiCT (%build)
I blame 11c25a4, because two examples of JSON are not valid JSON documents according to JSONLint.
Complete build log listing all packages used and all steps taken to reproduce.
This patch makes documentation to be buildable:
---
Doc/howto/logging-cookbook.rst | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -340,10 +340,12 @@ adding a ``filters`` section parallel to
.. code-block:: json
- "filters": {
- "warnings_and_below": {
- "()" : "__main__.filter_maker",
- "level": "WARNING"
+ {
+ "filters": {
+ "warnings_and_below": {
+ "()" : "__main__.filter_maker",
+ "level": "WARNING"
+ }
}
}
@@ -351,12 +353,14 @@ and changing the section on the ``stdout
.. code-block:: json
- "stdout": {
- "class": "logging.StreamHandler",
- "level": "INFO",
- "formatter": "simple",
- "stream": "ext://sys.stdout",
- "filters": ["warnings_and_below"]
+ {
+ "stdout": {
+ "class": "logging.StreamHandler",
+ "level": "INFO",
+ "formatter": "simple",
+ "stream": "ext://sys.stdout",
+ "filters": ["warnings_and_below"]
+ }
}
A filter is just a function, so we can define the ``filter_maker`` (a factoryLinked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
sobolevn commentedon Mar 11, 2023
Can you please submit a PR?
Fix invalid JSON in Doc/howto/logging-cookbook.rst
Update python310 to version 3.10.10 / rev 30 via SR 1071070
Fix invalid JSON in Doc/howto/logging-cookbook.rst
gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635
pythongh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (p…
pythongh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (p…
[3.11] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (G…
[3.10] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (G…
pythongh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (p…