[issue44030] Markup with_traceback code example

Terry J. Reedy report at bugs.python.org
Tue May 4 06:24:38 EDT 2021


New submission from Terry J. Reedy <tjreedy at udel.edu>:

.../Doc/library/exceptions.rst, lines 99-105 has

      original ``SomeException`` had we allowed it to propagate to the caller.

         try:
             ...
         except SomeException:
             tb = sys.exc_info()[2]
             raise OtherException(...).with_traceback(tb)

The code example with no markup except indents does not work because without a new indent, the last line is merged with the preceding one as part of the same paragraph.

https://docs.python.org/3.10/library/exceptions.html#BaseException.with_traceback

        traceback of the original SomeException had we allowed it to propagate to the caller.

            try:

                …
            except SomeException:

                tb = sys.exc_info()[2] raise OtherException(…).with_traceback(tb)

Note also the uneven line spacing, which is different for me here with Firefox that in the web page (also with Firefox).  Something different is needed, but I do not know what.

----------
assignee: docs at python
components: Documentation
messages: 392871
nosy: docs at python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Markup with_traceback code example
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44030>
_______________________________________


More information about the Python-bugs-list mailing list