Skip to content

Empty _sources directory created even with html_copy_source disabled #13888

@AlexanderS

Description

@AlexanderS

Describe the bug

Since 8.2.0 the html builder creates an empty _sources/ directory, even if html_copy_source is set to False. This was introduced by commit 285908a.

How to Reproduce

echo "" > index.rst
echo "html_copy_source = False" > conf.py
sphinx-build -M html . _build
ls -d _build/html/_sources

Environment Information

Platform:              linux; (Linux-6.1.0-0.deb11.21-amd64-x86_64-with-glibc2.41)
Python version:        3.13.7 (main, Aug 20 2025, 22:17:40) [GCC 14.3.0])
Python implementation: CPython
Sphinx version:        8.2.3
Docutils version:      0.21.2
Jinja2 version:        3.1.6
Pygments version:      2.19.2

Sphinx extensions

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting:responseWaiting for a response from the author of this issuetype:bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions