Skip to content

Do not mangle Python stack traces in sphinx-build #25160

@saraedum

Description

@saraedum

This upstreams part of Debian's u2-better-sphinx-failure-modes.patch by Ximin Luo: we should not .strip() the lines that come out of Sphinx because this breaks indent in stack traces. Instead we should only rstrip() to remove the trailing newline.

After this one line change, I also wanted to make this doctestable, so I had to remove the global variable (which at least to me feels like a hack anyway.)

Finally, I added a copyright header sourced from the git log.

CC: @infinity0

Component: doctest framework

Author: Julian Rüth

Branch: 67aff77

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/25160

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions