This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Missing HTML span element in exceptions.html
Type: Stage: resolved
Components: Documentation Versions: Python 3.10
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: ajaksu2, docs@python, vivekvashist
Priority: normal Keywords:

Created on 2021-12-19 07:07 by vivekvashist, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Screen Shot 2021-12-19 at 5.29.54 pm.png vivekvashist, 2021-12-19 07:07
Messages (3)
msg408886 - (view) Author: Vivek Vashist (vivekvashist) * Date: 2021-12-19 07:07
Link:
https://docs.python.org/3/library/exceptions.html#exception-hierarchy

Looking at EncodingWarning under exception-hierarchy is displaying BLACK color instead of RED. 

Digging into HTML looks like it is missing the appropriate span class element.

Working:

<span class="o">+--</span> <span class="ne">BytesWarning</span>

Broken:

<span class="o">+--</span> <span class="n">EncodingWarning</span>

See attached screenshot. 

I"m not too familiar with Sphinx but I'm happy to create a PR for this issue if someone could point me in right direction on how to fix this.
msg408900 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2021-12-19 14:23
That happens because EncodingWarning isn't highlighted as an Exception by Pygments[0]. The doc page gets its exceptions diagram by:
".. literalinclude:: ../../Lib/test/exception_hierarchy.txt"
and all other entries are recognized by Pygments, so we get the "ne" class for them.

A PR for Pygments adding EncodingWarning could be interesting, but I'm not sure the doc build process would pick it up and fix the 3.10 docs issue.

For 3.11, the diagram drawing was changed so no highlighting happens anymore, which fixes the issue for us in the long run.

[0] https://github.com/pygments/pygments/blob/8630e033313647d9579e314f3e8e2882f4558933/pygments/lexers/python.py#L225
msg408938 - (view) Author: Vivek Vashist (vivekvashist) * Date: 2021-12-20 01:22
Thanks for the information Daniel.
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90285
2021-12-21 00:33:35vivekvashistsetstatus: open -> closed
resolution: not a bug
stage: resolved
2021-12-20 01:22:16vivekvashistsetmessages: + msg408938
2021-12-19 14:23:41ajaksu2setnosy: + ajaksu2
messages: + msg408900
2021-12-19 07:07:18vivekvashistcreate