Skip to content

gettext incorrectly escapes trailing backslashes #13685

@ZeroIntensity

Description

@ZeroIntensity

Describe the bug

Sphinx's gettext extraction escapes trailing backslashes into \\, while the HTML correctly merges them with the next line.

How to Reproduce

$ echo "My hovercraft is \\ \nfull of eels." > index.rst
$ make gettext
$ tail -2 _build/gettext/index.pot
msgid "My hovercraft is \\ full of eels."
msgstr ""

Environment Information

Platform:              linux; (Linux-6.13.6-arch1-1-x86_64-with-glibc2.41)
Python version:        3.13.2 (main, Feb  5 2025, 08:05:21) [GCC 14.2.1 20250128])
Python implementation: CPython
Sphinx version:        8.2.3
Docutils version:      0.21.2
Jinja2 version:        3.1.6
Pygments version:      2.19.1

Sphinx extensions

None

Additional context

Noticed in python/cpython#135781
cc @picnixz

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions