Skip to content

馃悰 fix(ci): suppress Pygments DeprecationWarning on Python 3.15 - #3733

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix-pygments-py315
Feb 17, 2026
Merged

馃悰 fix(ci): suppress Pygments DeprecationWarning on Python 3.15#3733
gaborbernat merged 2 commits into
tox-dev:mainfrom
gaborbernat:fix-pygments-py315

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

Python 3.15 deprecated os.path.commonprefix() and Pygments 2.19.2 calls it internally in its regex optimization. With filterwarnings = "error" in the pytest config, this DeprecationWarning gets promoted to an error, causing a pytest INTERNALERROR that crashes the entire test suite on Python 3.15 across all platforms (ubuntu, macos, windows).

The fix adds a targeted warning filter to suppress this specific deprecation from the stdlib genericpath module until Pygments releases a fix upstream.

Python 3.15 deprecated os.path.commonprefix() and Pygments 2.19.2
calls it internally. With filterwarnings = "error" in pytest config,
this causes an INTERNALERROR crashing the entire test suite on
Python 3.15 across all platforms.
@gaborbernat
gaborbernat enabled auto-merge (squash) February 17, 2026 21:12
@gaborbernat
gaborbernat merged commit c4552f6 into tox-dev:main Feb 17, 2026
28 checks passed
gaborbernat added a commit that referenced this pull request Feb 17, 2026
$(cat <<EOF
## Summary
- The `:pygments` module scope on the `os.path.commonprefix()`
deprecation filter from #3733 never matched because the warning is
raised from `<frozen genericpath>` (stdlib), not from the calling
library
- Drop the module scope so the filter actually suppresses the warning
- Add upstream issue link for pyproject-hooks which also uses
`commonprefix`

Upstream issues:
- pygments/pygments#3039
- pypa/pyproject-hooks#223

## Test plan
- [ ] CI passes on Python 3.15 without `INTERNALERROR`

馃 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)
@gaborbernat
gaborbernat deleted the fix-pygments-py315 branch February 18, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant