Skip to content

Allow suppressing unmatched toctree glob warnings - #14626

Open
exhuma wants to merge 3 commits into
sphinx-doc:masterfrom
exhuma:fix-empty-glob
Open

Allow suppressing unmatched toctree glob warnings#14626
exhuma wants to merge 3 commits into
sphinx-doc:masterfrom
exhuma:fix-empty-glob

Conversation

@exhuma

@exhuma exhuma commented Aug 20, 2026

Copy link
Copy Markdown

This fixed an issue that prevented these log-messages from being suppressed via suppress_warnings.

Fixes #14625

Purpose

Currently, "empty-glob" warnings cannot be suppressed. This blocks us from using the "--fail-on-warning" option while also having "placeholder" glob-entries for future documents.

References

See #14625

AI Disclosure

The changes have been made manually (100% human) but AI helped to discover the bug. OpenCode with GPT5.5-Terra was used to pinpoint the root-cause. The code edit, bug-report and PR were all made by hand.

This fixed an issue that prevented these log-messages from being
suppressed via `suppress_warnings`.

Fixes sphinx-doc#14625
@exhuma

exhuma commented Aug 20, 2026

Copy link
Copy Markdown
Author

I saw that the CI fails but on my local machine there are no issues. The output is a bit verbose and couldn't spot the tests in question. Not sure if that's from the skipped tests on my local machine or something from the environment.

Here's my test-output:

pytest-output.txt

@jdillard jdillard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example of the warning output, since I didn't see it posted anywhere:

index.rst:7: WARNING: toctree glob pattern 'modules/*' didn't match any documents [toc.empty_glob]

Comment thread CHANGES.rst Outdated
@jdillard jdillard added this to the 9.1.1 milestone Aug 20, 2026
Comment thread sphinx/directives/other.py
@exhuma

exhuma commented Aug 21, 2026

Copy link
Copy Markdown
Author

@jdillard The branch now contains a couple of commits, due to the styling fixes. Would you like me to squash them and force-push the branch? It would keep the history cleaner.

@jdillard

Copy link
Copy Markdown
Member

No its fine, everything gets squashed at merge

@jdillard jdillard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jdillard jdillard changed the title Add missing "type" attribute to logger Allow suppressing unmatched toctree glob warnings Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"empty glob" warnings cannot be suppressed.

2 participants