Skip to content

CPython’s C-level docstrings contain malformed RST markup #146657

@timosachsenberg

Description

@timosachsenberg

Bug report

When building the documentation for pyOpenMS (after switching from Cython to nanobind) we ran into issues with Sphinx. I put here the analysis from an agent. Would be great if you could confirm if this should be fixed in nanobind or CPython.
Enums created with nb::is_arithmetic() inherit from Python’s int, which exposes methods like from_bytes() and to_bytes() on every enum type. These inherited methods carry CPython’s C-level docstrings, which contain malformed RST markup - specifically, backtick-apostrophe patterns like sys.byteorder' instead of sys.byteorder`.
When Sphinx autodoc processes these enums, it emits dozens of warnings:
WARNING: Inline interpreted text or phrase reference start-string without end-string [docutils]

Bug description:

see wjakob/nanobind#1317

CPython versions tested on:

3.14, 3.12, 3.10, 3.11, 3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions