Skip to content

Another invalid JSON in #102582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mcepl opened this issue Mar 10, 2023 · 1 comment
Closed

Another invalid JSON in #102582

mcepl opened this issue Mar 10, 2023 · 1 comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@mcepl
Copy link
Contributor

mcepl commented Mar 10, 2023

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 factory

Linked PRs

@mcepl mcepl added the docs Documentation in the Doc dir label Mar 10, 2023
@sobolevn
Copy link
Member

Can you please submit a PR?

@sobolevn sobolevn added the type-bug An unexpected behavior, bug, or error label Mar 11, 2023
mcepl added a commit to openSUSE-Python/cpython that referenced this issue Mar 12, 2023
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Mar 15, 2023
https://build.opensuse.org/request/show/1071070
by user mcepl + dimstar_suse
- Add invalid-json.patch fixing invalid JSON in
  Doc/howto/logging-cookbook.rst (somehow similar to
  gh#python/cpython#102582).
mcepl added a commit to openSUSE-Python/cpython that referenced this issue Mar 26, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 29, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 29, 2023
vsajip pushed a commit that referenced this issue Mar 29, 2023
vsajip pushed a commit that referenced this issue Mar 29, 2023
@vsajip vsajip closed this as completed Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants