Bug 2424573

Summary: python-readme-renderer fails to build with Python 3.15: test_cli_package: No content rendered from RST source.
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-readme-rendererAssignee: Michel Lind <michel>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: davide, epel-packagers-sig, fti-bugs, ksurma, mhroncok, michel, romain.geissler
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-readme-renderer-44.0-11.fc45 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-06-10 17:06:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2412434, 2433833, 2433836, 2485992, 2485854, 2485896, 2485924, 2485976    

Description Karolina Surma 2025-12-23 11:24:11 UTC
python-readme-renderer fails to build with Python 3.15.0a3.

_ test_cli_package[docutils-Docutils is a modular system for processing documentation] _

package = 'docutils'
contains = 'Docutils is a modular system for processing documentation'

    @pytest.mark.parametrize("package, contains", [
        ("readme_renderer", "Readme Renderer is a library that will safely render"),
        ("docutils", "Docutils is a modular system for processing documentation"),
    ])
    def test_cli_package(package, contains):
        with mock.patch("builtins.print") as print_:
>           main(["-p", package])

tests/test_cli.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cli_args = ['-p', 'docutils']

    def main(cli_args: Optional[List[str]] = None) -> None:
        parser = argparse.ArgumentParser(
            description="Renders a .md, .rst, or .txt README to HTML",
        )
        parser.add_argument("-p", "--package", help="Get README from package metadata",
                            action="store_true")
        parser.add_argument("-f", "--format", choices=["md", "rst", "txt"],
                            help="README format (inferred from input file name or package)")
        parser.add_argument('input', help="Input README file or package name")
        parser.add_argument('-o', '--output', help="Output file (default: stdout)",
                            default='-')
        args = parser.parse_args(cli_args)
    
        content_format = args.format
        if args.package:
            message = metadata(args.input)
            source = message.get_payload()  # type: ignore[attr-defined] # noqa: E501 https://peps.python.org/pep-0566/
    
            # Infer the format of the description from package metadata.
            if not content_format:
                content_type = message.get("Description-Content-Type", "text/x-rst")
                if content_type == "text/x-rst":
                    content_format = "rst"
                elif content_type == "text/markdown":
                    content_format = "md"
                elif content_type == "text/plain":
                    content_format = "txt"
                else:
                    raise ValueError(f"invalid content type {content_type} for package "
                                     "`long_description`")
        else:
            filename = pathlib.Path(args.input)
            content_format = content_format or filename.suffix.lstrip(".")
            with filename.open() as fp:
                source = fp.read()
    
        if content_format == "md":
            rendered = render_md(source, stream=sys.stderr)
        elif content_format == "rst":
            rendered = render_rst(source, stream=sys.stderr)
        elif content_format == "txt":
            rendered = render_txt(source, stream=sys.stderr)
        else:
            raise ValueError(f"invalid README format: {content_format} (expected `md`, "
                             "`rst`, or `txt`)")
        if rendered is None:
>           sys.exit(1)
E           SystemExit: 1

readme_renderer/__main__.py:57: SystemExit
----------------------------- Captured stderr call -----------------------------
No content rendered from RST source.
=========================== short test summary info ============================
FAILED tests/test_cli.py::test_cli_package[readme_renderer-Readme Renderer is a library that will safely render]
FAILED tests/test_cli.py::test_cli_package[docutils-Docutils is a modular system for processing documentation]
=================== 2 failed, 88 passed, 2 skipped in 0.34s ====================

https://docs.python.org/3.15/whatsnew/3.15.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/09935409-python-readme-renderer/

For all our attempts to build python-readme-renderer with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/python-readme-renderer/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Karolina Surma 2026-06-06 18:24:44 UTC
*** Bug 2485951 has been marked as a duplicate of this bug. ***