GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Another invalid JSON in · Issue #102582 · python/cpython

Another invalid JSON in  #102582

New issue
Copy link
New issue
Copy link
Closed
Closed
Another invalid JSON in #102582
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@mcepl
mcepl
opened on Mar 10, 2023
Issue body actions

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

  • gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst #102635
  • [3.11] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) #103106
  • [3.10] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) #103107

Activity

  1. mcepl
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Mar 10, 2023
  2. sobolevn commented on Mar 11, 2023

    @sobolevn
    sobolevn
    on Mar 11, 2023
    Member
    More actions

    Can you please submit a PR?

  3. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Mar 11, 2023
  4. mcepl
    added a commit that references this issue on Mar 12, 2023

    Fix invalid JSON in Doc/howto/logging-cookbook.rst

    This issue will close once commit bf18cda is merged into the 'opensuse_3.6' branch.
    bf18cda
  5. bmwiedemann
    added a commit that references this issue on Mar 15, 2023

    Update python310 to version 3.10.10 / rev 30 via SR 1071070

    9004499
  6. mcepl
    added a commit that references this issue on Mar 26, 2023

    Fix invalid JSON in Doc/howto/logging-cookbook.rst

    This issue will close once commit 59e12a6 is merged into the 'opensuse_3.6' branch.
    59e12a6
  7. vsajip
    added a commit that references this issue on Mar 29, 2023

    gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635

    d835b3f
  8. miss-islington
    added 2 commits that reference this issue on Mar 29, 2023

    pythongh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (p…

    ad2e3f4

    pythongh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (p…

    5527e70
  9. vsajip
    added 2 commits that reference this issue on Mar 29, 2023

    [3.11] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (G…

    d189e2d

    [3.10] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (G…

    473fd7b
  10. vsajip
    closed this as completedon Mar 29, 2023
  11. warsaw
    added a commit that references this issue on Apr 11, 2023

    pythongh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (p…

    417312a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.